Same code build twice => diff binary

  • Thread starter Thread starter Viviana Vc
  • Start date Start date
V

Viviana Vc

Hi all,

I am using Win2k, VS. NET 7.1 (MS development Environment 2003 7.1.3088)
and I noticed that by building the exact same code twice the generated
binaries are different (not much, but they are). To be sure I tried a
simple console application like void main(){} and 2 times rebuilding the
project gets 2 different binaries.

Has anybody any clue why this happens?
Could I somehow change a setting or something to remove those diff (I
mean from the same code to get identical binaries)?

Thanks in advance,
Viv
 
Viviana Vc said:
Hi all,

I am using Win2k, VS. NET 7.1 (MS development Environment 2003 7.1.3088)
and I noticed that by building the exact same code twice the generated
binaries are different (not much, but they are). To be sure I tried a
simple console application like void main(){} and 2 times rebuilding the
project gets 2 different binaries.

Has anybody any clue why this happens?
Could I somehow change a setting or something to remove those diff (I
mean from the same code to get identical binaries)?

Thanks in advance,
Viv

void main(){} is undefined bahaviour therefore the compiler is free to do
what it wants. Vey unlikely this is the cause however. I am not sure about
the format of an exe, but could it be the timestamps that are causing them
to be different?
Allan
 
Hi, Viviana

depending on settings you can get different timestamps and versions in
binaries. Which will cause different hashes and some other fields - don't
remember now exactly wich ones. If you are really interested - check PE
format description for .Net assemblies on MSDN.

HTH
Alex
 
Viviana said:
I am using Win2k, VS. NET 7.1 (MS development Environment 2003
7.1.3088) and I noticed that by building the exact same code twice the
generated binaries are different (not much, but they are). To be sure
I tried a simple console application like void main(){} and 2 times
rebuilding the project gets 2 different binaries.

Has anybody any clue why this happens?

At least the time-stamp is different.


Could I somehow change a setting or something to remove those diff (I
mean from the same code to get identical binaries)?

In general: No. You can change the timestamp "by hand".


For more info see:
Microsoft Portable Executable and Common Object File Format
Specification
http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx


It was already discussed several times in some newsgroups; see for
example:
http://groups.google.de/groups?&threadm=enwAkowrBHA.600@tkmsftngp04


--
Greetings
Jochen

Do you need a memory-leak finder ?
http://www.codeproject.com/tools/leakfinder.asp

Do you need daily reports from your server?
http://sourceforge.net/projects/srvreport/
 
Back
Top