<<< Date Index >>>     <<< Thread Index >>>

Re: [PATCH] init warning



> Right. On AMD-64 (and probably the other x86-64 architectures too), off_t is
> 8 bytes, and so is "long int". So we don't need to use "%lld", just "%ld".

Sadly I don't think it's that simple, although I'm by no means an expert
and I haven't paid much attention to 64-bt vs 32-bit issues since I put
away my AlphaStation.

Some platforms use an LP64 data model (longs, long longs, and pointers
are 64-bit), and others use LLP64 (only long longs and pointers are
64-bit).  IIRC, printf formatters need to correspond even for %{l,ll}d.
And making things worse, it's not based strictly on the hardware
architecture; while that obviously plays a part, it's really the
compiler at issue.  As I recall, Microsoft's compiler(s) on 64-bit
Alpha used LLP64, so that long ints are 32-bit still; off_t would be
a long long int.  I assume that they're the same on current Intel/AMD
platforms.  But I believe all the common compilers for POSIX use LP64,
so that %ld and %lld are interchangeable.

I hope I'm misremembering, but I'm pretty sure this is why you see a
fair amount of code that takes pains to use macros for its integer
formatters.

On the other hand: does mutt even support (in the policy sense)
Microsoft compilers?  Or just gcc under MinGW or Cygwin?  Or not even
that?

-- 
 -D.    dgc@xxxxxxxxxxxx    NSIT    University of Chicago