Menu

#1570 GCC 6 build issues.

SVN past 0.9.10
closed-fixed
nobody
None
0.9.12
5
2020-09-24
2016-07-26
No

I suspect this is already known but I could not find a bug raised for it.

GCC seems to have tightened up on a few things that would have normally been allowed in GCC 5.

When trying to build on GCC 6 on Fedora, the following errors occur:

In file included from arm_instructions.cpp:35:0:
MMU_timing.h: In instantiation of class CacheController<13, 2, 5>:
MMU_timing.h:253:26:   required from here
MMU_timing.h:158:28: error: left operand of shift expression (-1 << 11) is negative [-fpermissive]
  enum { TAGMASK = (u32)(~0 << TAGSHIFT) };
                        ~~~~^~~~~~~~~~~~
MMU_timing.h:158:7: error: enumerator value for TAGMASK is not an integer constant
  enum { TAGMASK = (u32)(~0 << TAGSHIFT) };
       ^
MMU_timing.h:159:61: error: left operand of shift expression (-1 << 5) is negative [-fpermissive]
  enum { BLOCKMASK = ((u32)~0 >> (32 - TAGSHIFT)) & (u32)(~0 << BLOCKSIZESHIFT) };
                                                         ~~~~^~~~~~~~~~~~~~~~~~
MMU_timing.h:159:7: error: enumerator value for BLOCKMASK is not an integer constant
  enum { BLOCKMASK = ((u32)~0 >> (32 - TAGSHIFT)) & (u32)(~0 << BLOCKSIZESHIFT) };
       ^
MMU_timing.h: In instantiation of class CacheController<12, 2, 5>:
MMU_timing.h:254:26:   required from here
MMU_timing.h:158:28: error: left operand of shift expression (-1 << 10) is negative [-fpermissive]
  enum { TAGMASK = (u32)(~0 << TAGSHIFT) };
                        ~~~~^~~~~~~~~~~~
MMU_timing.h:158:7: error: enumerator value for TAGMASK is not an integer constant
  enum { TAGMASK = (u32)(~0 << TAGSHIFT) };
       ^
MMU_timing.h:159:61: error: left operand of shift expression (-1 << 5) is negative [-fpermissive]
  enum { BLOCKMASK = ((u32)~0 >> (32 - TAGSHIFT)) & (u32)(~0 << BLOCKSIZESHIFT) };
                                                         ~~~~^~~~~~~~~~~~~~~~~~
MMU_timing.h:159:7: error: enumerator value for BLOCKMASK is not an integer constant
  enum { BLOCKMASK = ((u32)~0 >> (32 - TAGSHIFT)) & (u32)(~0 << BLOCKSIZESHIFT) };
       ^
In file included from armcpu.cpp:32:0:
MMU_timing.h: In instantiation of class CacheController<13, 2, 5>:
MMU_timing.h:253:26:   required from here
MMU_timing.h:158:28: error: left operand of shift expression (-1 << 11) is negative [-fpermissive]
  enum { TAGMASK = (u32)(~0 << TAGSHIFT) };
                        ~~~~^~~~~~~~~~~~
MMU_timing.h:158:7: error: enumerator value for TAGMASK is not an integer constant
  enum { TAGMASK = (u32)(~0 << TAGSHIFT) };
       ^
MMU_timing.h:159:61: error: left operand of shift expression (-1 << 5) is negative [-fpermissive]
  enum { BLOCKMASK = ((u32)~0 >> (32 - TAGSHIFT)) & (u32)(~0 << BLOCKSIZESHIFT) };
                                                         ~~~~^~~~~~~~~~~~~~~~~~
MMU_timing.h:159:7: error: enumerator value for BLOCKMASK is not an integer constant
  enum { BLOCKMASK = ((u32)~0 >> (32 - TAGSHIFT)) & (u32)(~0 << BLOCKSIZESHIFT) };
       ^
MMU_timing.h: In instantiation of class CacheController<12, 2, 5>:
MMU_timing.h:254:26:   required from here
MMU_timing.h:158:28: error: left operand of shift expression (-1 << 10) is negative [-fpermissive]
  enum { TAGMASK = (u32)(~0 << TAGSHIFT) };
                        ~~~~^~~~~~~~~~~~
MMU_timing.h:158:7: error: enumerator value for TAGMASK is not an integer constant
  enum { TAGMASK = (u32)(~0 << TAGSHIFT) };
       ^
MMU_timing.h:159:61: error: left operand of shift expression (-1 << 5) is negative [-fpermissive]
  enum { BLOCKMASK = ((u32)~0 >> (32 - TAGSHIFT)) & (u32)(~0 << BLOCKSIZESHIFT) };
                                                         ~~~~^~~~~~~~~~~~~~~~~~
MMU_timing.h:159:7: error: enumerator value for BLOCKMASK is not an integer constant
  enum { BLOCKMASK = ((u32)~0 >> (32 - TAGSHIFT)) & (u32)(~0 << BLOCKSIZESHIFT) };
       ^
make[2]: *** [armcpu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [arm_instructions.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1
In file included from armcpu.cpp:32:0:
MMU_timing.h: In instantiation of class CacheController<13, 2, 5>:
MMU_timing.h:253:26:   required from here
MMU_timing.h:158:28: error: left operand of shift expression (-1 << 11) is negative [-fpermissive]
  enum { TAGMASK = (u32)(~0 << TAGSHIFT) };
                        ~~~~^~~~~~~~~~~~
MMU_timing.h:158:7: error: enumerator value for TAGMASK is not an integer constant
  enum { TAGMASK = (u32)(~0 << TAGSHIFT) };
       ^
MMU_timing.h:159:61: error: left operand of shift expression (-1 << 5) is negative [-fpermissive]
  enum { BLOCKMASK = ((u32)~0 >> (32 - TAGSHIFT)) & (u32)(~0 << BLOCKSIZESHIFT) };
                                                         ~~~~^~~~~~~~~~~~~~~~~~
MMU_timing.h:159:7: error: enumerator value for BLOCKMASK is not an integer constant
  enum { BLOCKMASK = ((u32)~0 >> (32 - TAGSHIFT)) & (u32)(~0 << BLOCKSIZESHIFT) };
       ^
MMU_timing.h: In instantiation of class CacheController<12, 2, 5>:
MMU_timing.h:254:26:   required from here
MMU_timing.h:158:28: error: left operand of shift expression (-1 << 10) is negative [-fpermissive]
  enum { TAGMASK = (u32)(~0 << TAGSHIFT) };
                        ~~~~^~~~~~~~~~~~
MMU_timing.h:158:7: error: enumerator value for TAGMASK is not an integer constant
  enum { TAGMASK = (u32)(~0 << TAGSHIFT) };
       ^
MMU_timing.h:159:61: error: left operand of shift expression (-1 << 5) is negative [-fpermissive]
  enum { BLOCKMASK = ((u32)~0 >> (32 - TAGSHIFT)) & (u32)(~0 << BLOCKSIZESHIFT) };
                                                         ~~~~^~~~~~~~~~~~~~~~~~
MMU_timing.h:159:7: error: enumerator value for BLOCKMASK is not an integer constant
  enum { BLOCKMASK = ((u32)~0 >> (32 - TAGSHIFT)) & (u32)(~0 << BLOCKSIZESHIFT) };
       ^
make[2]: *** [armcpu.o] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [install-recursive] Error 1

Discussion

  • toxic shadow

    toxic shadow - 2016-07-26

    Simply being more explicit solves the issue above. Changing the ~0 to ~0U resolves that problem but unfortunately it fails later with the following error:

    ../ctrlssdl.cpp: In function ‘u16 get_joy_key(int)’:
    ../ctrlssdl.cpp:203:39: error: invalid operands of types ‘__gnu_cxx::__enable_if<true, double>::__type {aka double}’ and ‘int’ to binary ‘operator>>’
               if( (abs(event.jaxis.value) >> 14) != 0 )
                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
    ../ctrlssdl.cpp: In function ‘int do_process_joystick_events(u16*, SDL_Event*)’:
    ../ctrlssdl.cpp:373:36: error: invalid operands of types ‘__gnu_cxx::__enable_if<true, double>::__type {aka double}’ and ‘int’ to binary ‘operator>>’
           if( (abs(event->jaxis.value) >> 14) != 0 )
                ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
    
     
  • toxic shadow

    toxic shadow - 2016-07-26

    Casting the abs value to u32 solves the above issue and allows the build to complete successfully.

    Line 203 = if( ((u32)abs(event.jaxis.value) >> 14) != 0 )
    Line 373 = if( ((u32)abs(event->jaxis.value) >> 14) != 0 )

     
  • zeromus

    zeromus - 2016-07-26

    Fixed in r5514

     
    • Anonymous

      Anonymous - 2020-09-24

      I'm having this same problem. what is r5514?

       
      • zeromus

        zeromus - 2020-09-24

        An edit made to desmume over four years ago. Use sources newer than four years old and you won't have this problem. If you don't know what r5514 means then you don't need to be building from sources anyway.

         
        • Anonymous

          Anonymous - 2020-09-24

          Thats fair.

          I'm building for Ubuntu 18.04 using a tarball for v0.9.11. https://wiki.desmume.org/index.php?title=Installing_DeSmuME_from_source_on_Linux

          I've gotten past this issue and am now on to here https://github.com/TASVideos/desmume/issues/83

           
          • zeromus

            zeromus - 2020-09-24

            Don't use ancient 0.9.11 tarball for linux.
            Wifi.cpp has been revised 24 times since that bug was posted

             
  • toxic shadow

    toxic shadow - 2016-07-26

    problem with 5514. the cast has been put outside the brackets on the abs on line 373. line 203 is correct

     
  • zeromus

    zeromus - 2016-07-30

    fixed in r5517

     
  • toxic shadow

    toxic shadow - 2016-07-30

    confirmed fixed. Thanks.

     
  • rogerman

    rogerman - 2016-07-30
    • status: open --> closed-fixed
    • THERES NO POINT TO THIS LABEL: future --> SVN past 0.9.10
     
  • rogerman

    rogerman - 2016-07-30

    Closing, per user confirmation.

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB