Re: #include optimization
From: CBFalconer (cbfalconer_at_yahoo.com)
Date: 10/02/04
- Next message: Jack Klein: "Re: Compile and link"
- Previous message: David Hopwood: "Re: contiguity of arrays"
- In reply to: Michael Wojcik: "Re: #include optimization"
- Next in thread: Dave Thompson: "Re: #include optimization"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 02 Oct 2004 02:29:01 GMT
Michael Wojcik wrote:
> Peter van Merkerk <merkerk@deadspam.com> writes:
>>
>> Even if binary compare shows that there are differences all may be well
>> too. I learned this the hard way; compiling the same code twice with a
>> certain compiler yielded different binaries. Apparently the compiler
>> wrote the build date or something like that into the binary.
>
> All it takes is one reference to __DATE__ or __TIME__.
>
> I have projects where many of the TUs explicitly include build
> timestamps using __DATE__ and __TIME__, since that information can be
> useful in identifying precisely which build is being used. (Yes, the
> projects also have explicit version information, and the modules have
> version information that's updated automatically by the SCM system,
> but it doesn't hurt to have confirmation.)
>
> With that sort of project, binary comparison is basically useless.
> Chuck's method certainly can work in some projects, but for something
> the size that the OP is describing I suspect you'd spend a great deal
> of time investigating false positives.
No it isn't useless. The differing areas will generally be of the
same size, if you have taken the precautions I mentioned. A
decent binary difference utility will show the differing bytes and
carry on. Mine shows the offset, the numerical difference, the
xor, the hex values from each file, and if printable the char
values. Something with the only difference a datestamp will
normally show 5 to 10 bytes of difference, and all else is not
present in the output.
c:>fdiff
usage: FDIFF [/q] [/nnn] file1 file2
options /q prevents page pauses
/nnn (hex digits) sets addr display.
binary comparison between file1 and file2
Ex: FDIFF /q/100 fdiff.com fdiff.bin
no page pauses, addr starts as 0100h
-- Chuck F (cbfalconer@yahoo.com) (cbfalconer@worldnet.att.net) Available for consulting/temporary embedded and systems. <http://cbfalconer.home.att.net> USE worldnet address!
- Next message: Jack Klein: "Re: Compile and link"
- Previous message: David Hopwood: "Re: contiguity of arrays"
- In reply to: Michael Wojcik: "Re: #include optimization"
- Next in thread: Dave Thompson: "Re: #include optimization"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]