On Tue, May 31, 2011 at 6:44 PM, Ric Sherlock <[email protected]> wrote: > Showing my ignorance, but how does the compiler impact on the stored > structure? Is this an Endian issue or do different compilers store the > same type differently in other ways? I think that the gcc compiler has > been used until recently, but that the Intel compiler is likely to be > used going forward. > > It shouldn't be too big an issue to get test files to check against. > Yes sorting out the byte size and bit conversion method for each C > type seems like way to go.
The main issues are; 1. How big are each of the data types, in terms of address space? (How many bytes do you need to store an int?) 2. Where are different data types stored? (Does the compiler arrange the data so that they may be retrieved faster?) 3. Endianness (how are bytes organized, for multi-byte values?) Note that on some computers (for example the AS/400) the answers to these questions might be very different from what you might expect on an intel computer. But even if we assume an intel computer there can be different interpretations of these (32 bit ints vs. 64 bit ints, and packed structures vs. aligning 64 bit values on 64 bit boundaries). A good plausible interpretation is: 32 bit ints and floats, and packed data structures with fields always organized in the same order they were declared, but until you can verify that it remains an assumption (and one that's more likely true for older file formats than newer ones). -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
