Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Extra bytes in OSX vs classic binaries



I am porting to OSX some legacy F77 code that was developed using the Absoft compiler on Mac OS 6 through OS 9.

As a first step, I have been playing with G77 and PB and am having reasonable success. I got a test application up and running but encountered the following odd circumstance:

The F77 code reads and writes raw binary data files as input and output. These are read and written as a stream of 4-byte integers (they are simply copies of a contiguous block of COMMON data).

The binaries produced by the G77 version of code have an extra 4-byte chunk of data prepended at the front, and an *identical* 4-byte chunk appended to the end of each binary data file, so the data files produced by the G77-OSX version are exactly 8 bytes larger than the binaries produced by the Absoft code running under classic on the same machine. Other than these 8 errant bytes, the data files are, by actual inspection, identical.

Obviously, this circumstance renders data file transport between the classic and OSX platforms very problematic.

The 4-byte chunk appears to be a pointer to the end of the data since its decimal representation is exactly one less than the data size, plus 4 extra bytes for the appended chunk, in bytes (i.e., the classic data file size is 5544 bytes, the OSX data file is 5544 +8 = 5552 bytes, and the value of both (fore and aft) data-file-bracketing chunks is 0x[00][00][15][AB] = 5547 decimal.

Can anyone explain what this is all about and how I might get rid of those offending extra bytes without OSX-specific code modifications? A compiler flag of some sort perhaps (I couldn't find anything that looked remotely applicable in man G77)?

Thanks for any guidance,

Richard Hartman
_______________________________________________
fortran-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/fortran-dev
Do not post admin requests to the list. They will be ignored.




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.