Do you trust the "indent" program?

Michael Meissner meissner at osf.org
Wed Jan 2 15:41:35 AEST 1991


In article <1990Dec28.220527.16131 at jarvis.csri.toronto.edu>
flaps at dgp.toronto.edu (Alan J Rosenthal) writes:

| arnold at audiofax.com (Arnold Robbins) writes:
| >Andrew is fortunate enough to be running on a Unix system that doesn't
| >use COFF for it's object files --- COFF files have a timestamp in them.
| >If you know where it is (I don't) ...
| 
| sigh..
| just cmp -l the files.  if more than a few bytes are different, they're
| different, otherwise it's the timestamps.  I've done this, works fine.
| of course just compiling a program twice & "cmp -l" ing it will show you where
| the bytes are.  and there's always /usr/include/a.out.h.  no problem.

This doesn't always work with some object file formats out there.  For
example, with the MIPS ECOFF object file format, the filenames are put
into the object file.  The MIPS assembler explicitly puts an entry for
the assembly file into the table, even if the first line of the
assembly file is a .file to set the filename (it puts that in as
well).  If you have a compiler that produces assembly output and
invokes the assembler (such as GCC), the assembler input file is
invariably created using the process ID in the filename.  Two
successive runs will produce differences in the filenames stored.  One
of the things that I did in my MIPS debug patches to GCC, is strip out
the useless filename, so that only the timestamps will differ.

The OSF/rose object file format has the potential for the same problem
in that it has a field to record the command line of the object file
creator.  Thus if you compare .o's you will see differences, but if
you compare linked programs you won't (since the linker puts it's own
command line in the field).
--
Michael Meissner	email: meissner at osf.org		phone: 617-621-8861
Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142

Considering the flames and intolerance, shouldn't USENET be spelled ABUSENET?



More information about the Comp.lang.c mailing list