Could egcs warn at (int*)(int)(x)?

Tobias Polzin polzin00@marvin.informatik.uni-dortmund.de
Mon Dec 15 09:34:00 GMT 1997


I had problems with porting a software package to a 64 bit architecture.
After exhausting debugging-sessions I found that the problem were "pointer->
int->pointer"-casts which loose the upper 32 bit of the address. 
The usual warnings (-wAll -Wconversion -Wpointer-arith) do not detect
this porblems.

Is there any possibility to get warnings for things like:
   int* foo=(int*)((int)bar + delta);
Or even for
   int  delta= long(newaddress)-long(oldaddress).

Tobias "2b" Polzin



More information about the Gcc mailing list