D
Dan Pop
Try using gcc as a C compiler and it will no longer compile OK.
Try using them as C compilers and they should produce one diagnostic.
Most compilers are NOT conforming C compilers *by default*. You have to
check their documentation to figure out how to invoke them as conforming
C compilers (e.g. gcc needs -ansi -pedantic -ffloat-store).
Dan
According to the C standard:
1. "A cast does not yield an lvalue" (section 6.5.4, footnote 85).
2. "The operand of the postfix increment or decrement operator . . . shall
be a modifiable lvalue" (section 6.5.2.4, paragraph 1).
Oddly, none of my Windows compilers seem to have any objection to using the
result of a cast operation as the operand for a postfix increment operation.
Interesting.
Try using them as C compilers and they should produce one diagnostic.
Most compilers are NOT conforming C compilers *by default*. You have to
check their documentation to figure out how to invoke them as conforming
C compilers (e.g. gcc needs -ansi -pedantic -ffloat-store).
Dan