C
Christian Bau
Sidney Cadot said:Consider two programs:
/*** a.c ***/
#include <stdio.h>
int main(void)
{
fopen("somefile","rb");
return 0;
}
/*** b.c ***/
in main(void)
{
return 0;
}
Would it be legal for a compiler (through optimization), to emit the
same code for program a.c and b.c ?
I don't think so. The call to fopen () probably introduces observable
behavior that cannot be optimised away. Even if your C program doesn't
care, the outside world might care.