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
Anonymous
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:
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 )
Fixed in r5514
I'm having this same problem. what is r5514?
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.
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
Don't use ancient 0.9.11 tarball for linux.
Wifi.cpp has been revised 24 times since that bug was posted
problem with 5514. the cast has been put outside the brackets on the abs on line 373. line 203 is correct
fixed in r5517
confirmed fixed. Thanks.
Closing, per user confirmation.