From: George O. <G.O...@lb...> - 2010-10-12 14:29:13
|
Hi all. I'm trying to port some pre-existing code to sdcc for 8051. In some files, the original code uses gcc-style void * arithmetic, similar to this: static unsigned short foo[15]; void funct() { void * ptr; ptr = foo; /* ptr is X:0xe01a */ /* do something */ ptr = (void *)foo + 1; /* ptr is still X:0xe01a */ } Please correct me if I'm wrong but I would expect this code to cause warning 178: size of void is zero. Correct? sdcc doesn't produce a warning, while gcc -Wpointer-arith does. Needless to say, the code does not achieve what the developer originally intended, which makes things hard for me to debug. So my question here is, is there a way to turn on a warning for this scenario? Thanks for any tips all. Regards geo |