I created two C programs
Program 1
int main()
{
}
Program 2
int main()
{
//Some Harmless comments
The most common reason are file names and time stamps added by the compiler (usually in the debug info part of the ELF sections).
Try running
$ strings -a program > x
...recompile program...
$ strings -a program > y
$ diff x y
and you might see the reason. I once used this to find why the same source would cause different code when compiled in different directories. The finding was that the __FILE__
macro expanded to an absolute file name, different in both trees.