This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Endianess


> 
> >  This really sounds like a FAQ item to me, to clear this
> >  up once and for all...
> 
> [ Good points snipped, thanks ]
> 
> >  If your data file contains only an unstructures stream
> >  of 32 bit integers, you can use the following utility
> >  program to reverse byte ordering:
> 
> This is, unfortunately, not true in general.  A Fortran unformatted  
> sequential file *as generated by the f2c run time library* (and  
> hence by g77, whether part of egcs or combined with gcc) has the  
> following structure:
> 
> #-of-bytes-in-record, contents-of-record, #-of-bytes-in-previous-record
> ...
> 
> all concatenated in binary "words".


Thanks for the clarification about the binary file format -- I am not a FORTRAN
user, so I had no idea what the actual binary files look like in
FORTRAN -- my naive idea was they would come out as a stream of bytes
just like under "normal" (i.e., C-deriveed ;-) programming
languages...

What was a bit disconcerting to me was the use of phrases such as "PC
compilers", and "workstations compilers" which is of course totally
wrong because it's an architecture, not a compiler issue...

This item seems to have escaped the FORTRAN user's discussion, who do
not seem to be as familiar with bit layout of data types (and don't
have to be in general...)

mike


-- 
Michael K. Gschwind
IBM T.J. Watson Research Center     phone (external): (914) 945-3162
PO Box 218                          phone (internal): T/L 862-3162
Yorktown Heights, NY 10598          e-mail: mikeg@watson.ibm.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]