|
Problem compiling |
tobing
Member #5,213
November 2004
|
After some longer break, I have fetched the current sources and built. I encountered two problems, the other one is this: I'm compiling with some more strict warnings, including stuff about signed unsigned. Now I get two errors, one in base.h and one in system.c, which relate to Quote: Commit hash: b4239e8613ef560ca2c182efb8e02e693ef412b1 Use -2147483648 instead of 1 << 31 for ALLEGRO_UNSTABLE_BIT. The latter causes ubsan errors and implementation defined behavior I think this should be safe from a BC point of view. The warning looks like this: 1>t:\dev\ext\allegro51\src\allegro.c(29): error C2220: warning treated as error - no 'object' file generated I tried several things, including using (1<<31) instead of -2147483648, but things don't get better. It works with (1<<30), which is fine for me, but I guess that would break some compatibility when applied to the official allegro version. |
SiegeLord
Member #7,827
October 2006
|
What compiler is this? I think the error is wrong, but I suppose doing something like (-2147483647 - 1) might be a workaround. Your fix is fine too, for local development. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
tobing
Member #5,213
November 2004
|
I'm using Visual Studio 2017... and I have tried a bit more. It turns out that INT_MIN is defined as (-2147483647 - 1) so something is strange here. |
Peter Hull
Member #1,136
March 2001
|
0x80000000 shurely
|
SiegeLord
Member #7,827
October 2006
|
0x80000000 ends up being interpreted as a an unsigned integer, and at that point it's unclear how to safely convert it to a signed integer. I ended up just using INT_MIN instead, which, incidentally, is defined as follows on my system: # define INT_MIN (-INT_MAX - 1) # define INT_MAX 2147483647
"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
|