Do you trust the "indent" program?
Jody Hagins
hagins at gamecock.rtp.dg.com
Fri Dec 28 02:49:17 AEST 1990
In article <310 at audfax.audiofax.com>, arnold at audiofax.com (Arnold Robbins) writes:
|> >In article <12184 at sybase.sybase.com> forrest at sybase.com writes:
|> >> Do you trust 'indent'
|> >> enough to run it on all your source file without making any mistakes?
|>
|> Personally, no. See below for what I'd do if I had thousands of lines of
|> code to massage.
|>
|> In article <11742 at alice.att.com> ark at alice.UUCP () writes:
|> >I don't need to -- I can compile my programs before and after
|> >and compare the object files. If they're not identical,
|> >something's broken.
|>
|> 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), you can arrange to strip off the
|> COFF header and then compare the objects, but it is not as simple an
|> operation as it used to be.
The COFF header layout follows, for those interested, but without
the references.
COFF object file format specifies that the header is first, then
the optional (aout) header, followed by section headers, etc.
The file header is a <struct filehdr>, declared in filehdr.h.
The optional header is <struct aouthdr>, declared in aouthdr.h.
struct filehdr
{
unsigned short f_magic;
unsigned short f_nscns;
long f_timdat;
long f_symptr;
long f_nsyms;
unsigned short f_othdr;
unsigned short f_flags;
};
By looking at <struct filehdr>, we see that the time stamp is
at bytes 4-7.
All this can be (and was) found in the UNIX programmers guide.
--
Jody Hagins
hagins at gamecock.rtp.dg.com
Data General Corp.
62 Alexander Dr.
RTP, N.C. 27709
(919) 248-6035
More information about the Comp.lang.c
mailing list