Executable differ on twice compiled at the same time

When I compile an executable twice use command "/opt/SUNWspro/WS6U2/bin/cc -g" at he same time, and then use "diff" command to compare this twice output file, I found that they are different.

After use "strip" command to strip this two files, they are different also.

Why?

[291 byte] By [YangSevena] at [2007-11-27 10:48:17]
# 1

This question is answered here:

http://www.genunix.org/wiki/index.php/Sun_Studio_FAQs#Compilers_-_Why_does_the_ same_source_produce_different_object_files.3F

MaximKartasheva at 2007-7-28 22:25:43 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2

Dear MaximKartashev ,

Thanks very much!

When use "-g" option, the executable file sould be different after twice compilation, even we use "strip" command.

Right?

YangSevena at 2007-7-28 22:25:43 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 3

> When use "-g" option, the executable file sould be different after twice compilation,

> even we use "strip" command.

As far as I understand, no, but that is only true if you don't use optimization.

MaximKartasheva at 2007-7-28 22:25:43 > top of Java-index,Development Tools,Solaris and Linux Development Tools...