P
pete b
Given this code:
void f(void){}
int main(void){return (int)f+5;}
Is there anything wrong with this in terms of the standards? Is this
legal C code? One compiler I'm working with compiles this quietly, even
with the most stringent and pedantic ANSI and warning levels, but
generates code that only loads the address of "f" and fails to make the
addition before returning a value from "main".
GCC "does the right thing".
Is there something I'm missing?
void f(void){}
int main(void){return (int)f+5;}
Is there anything wrong with this in terms of the standards? Is this
legal C code? One compiler I'm working with compiles this quietly, even
with the most stringent and pedantic ANSI and warning levels, but
generates code that only loads the address of "f" and fails to make the
addition before returning a value from "main".
GCC "does the right thing".
Is there something I'm missing?