A GCCism:
-Wpointer-arith
Warn about anything that depends on the ``size of'' a
function type or of "void". GNU C assigns these types a
size of 1, for convenience in calculations with "void *"
pointers and pointers to functions.
Posted Mar 20, 2008 18:34 UTC (Thu) by dododge (subscriber, #2870)
[Link]
The lesson being: when you run "gcc" with no options, it does not compile the C language, but
rather the "GNU C" language. GNU C bears a strong resemblance to C but has many additional
and alternate semantics.
If you're trying to write portable code and you want gcc to follow Standard C rules, you have
to explicitly request it. I normally use, at a minimum:
-std=c99 -pedantic -Wall -Wextra