I am curious about the liberties that a compiler has when optimizing. Let\'s limit this question to GCC and C/C++ (any version, any flavour of standard):
Is it possi
Two different C programs:
foo6.c
void p2(void);
int main() {
p2();
return 0;
}
bar6.c
#include
char main;
void p2() {
printf("0x%x\n", main);
}
When both modules are compiled into one excecutable with optimization levels one and zero, they print out two different values. 0x48 for -O1 and 0x55 for -O0
Screenshot of terminal
Here is an example of it working in my environment