Philip Warner wrote:
> At 12:00 PM 22/10/2002 -0400, Bruce Momjian wrote:
> >It does have the advantage of being more portable on systems
> >that do have integral off_t
> I suspect it is no more portable than determining storage order by using 
> 'int i = 256', then writing in storage order, and has the disadvantage that 
> it may break as discussed.
> AFAICT, using storage order will not break under any circumstances within 
> one OS/architecture (unlike using shift), and will not break any more often 
> than using shift in cases where off_t is integral.

Your version will break more often because we are assuming we can
determine the endian-ness of the OS, _and_ for quad off_t types,
assuming we know that is stored the same too.  While we have ending for
int's, I have no idea if quads are always stored the same.  By accessing
it as an integral type, we make certain it is output the same way every
time for every OS.

  Bruce Momjian                        |
  [EMAIL PROTECTED]               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to