Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!mcnc!rti!dg-rtp!gamecock!hagins From: hagins@gamecock.rtp.dg.com (Jody Hagins) Newsgroups: comp.lang.c Subject: Re: Do you trust the "indent" program? Message-ID: <1990Dec27.154917.9776@dg-rtp.dg.com> Date: 27 Dec 90 15:49:17 GMT References: <12184@sybase.sybase.com> <11742@alice.att.com> <310@audfax.audiofax.com> Sender: usenet@dg-rtp.dg.com (Usenet Administration) Reply-To: hagins@gamecock.rtp.dg.com (Jody Hagins) Organization: Data General Corporation, Research Triangle Park, NC Lines: 57 In article <310@audfax.audiofax.com>, arnold@audiofax.com (Arnold Robbins) writes: |> >In article <12184@sybase.sybase.com> forrest@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@alice.att.com> ark@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 , declared in filehdr.h. The optional header is , 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 , 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@gamecock.rtp.dg.com Data General Corp. 62 Alexander Dr. RTP, N.C. 27709 (919) 248-6035