project-navigation
Personal tools

Author Topic: 24180 - Compile concerns  (Read 4045 times)

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
24180 - Compile concerns
« 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

Offline bayo

  • Professional loser
  • Project Coder
  • Captain
  • ***
  • Posts: 733
    • View Profile
Re: 24180 - Compile concerns
« Reply #1 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?

Koryon

  • Guest
Re: 24180 - Compile concerns
« Reply #2 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?

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: 24180 - Compile concerns
« Reply #3 on: April 27, 2009, 08:10:43 am »
oh... that warning was introduced by me. i'll ask duke and wilminator about it

Offline Duke

  • Administrator
  • PHALANX veteran
  • *****
  • Posts: 1037
    • View Profile
Re: 24180 - Compile concerns
« Reply #4 on: April 27, 2009, 09:07:50 pm »
I got rid of the warnings ==> rev 24249.