UFO:Alien Invasion

Archive => Bugs prior to release 2.3 => Topic started by: keybounce on April 25, 2009, 06:13:51 pm

Title: 24180 - Compile concerns
Post by: keybounce on April 25, 2009, 06:13:51 pm
These compile warnings are concerning. This is on a PPC mac:
src/common/cmodel.c: In function ‘Grid_MoveMark’:
src/common/cmodel.c:1637: warning: comparison is always true due to limited range of data type
src/common/cmodel.c:1692: warning: comparison is always true due to limited range of data type
src/common/cmodel.c:1901: warning: comparison is always true due to limited range of data type
src/common/cmodel.c: In function ‘Grid_MoveCalc’:
src/common/cmodel.c:1960: warning: comparison is always true due to limited range of data type
src/common/cmodel.c: In function ‘Grid_MoveLength’:
src/common/cmodel.c:2017: warning: comparison is always true due to limited range of data type
Title: Re: 24180 - Compile concerns
Post by: bayo on April 26, 2009, 01:36:53 pm
Hello, i only check the line 1637:

x, y, z are int
crouchingState are byte

is byte type unsigned on Mac?
Title: Re: 24180 - Compile concerns
Post by: Koryon on April 26, 2009, 03:12:16 pm
<<Intel Mac>>

I don't know where byte is being defined for this specific file, but grep -r " byte;" src/ does return that it is always defined as an unsigned char or uint8_t which in turn is always unisgned char.

So yes it's unsigned, and the asserts in all these lines will always be true.  So I guess is it supposed to be unsigned?
Title: Re: 24180 - Compile concerns
Post by: Mattn on April 27, 2009, 08:10:43 am
oh... that warning was introduced by me. i'll ask duke and wilminator about it
Title: Re: 24180 - Compile concerns
Post by: Duke on April 27, 2009, 09:07:50 pm
I got rid of the warnings ==> rev 24249.