Re: print 64bit-integer
- From: Richard Heathfield <rjh@xxxxxxxxxxxxxxx>
- Date: Mon, 11 May 2009 07:14:39 +0000
Chris McDonald said:
Richard Heathfield <rjh@xxxxxxxxxxxxxxx> writes:
I'm not convinced about the "portable"! :-) Nor am I convinced of
the existence of a PRId64 modifier, but this may simply be because
I have paid little attention to C99. I have taken a brief look at
what the Standard has to say on the matter, but alas, I remain
unconvinced. Can you convince me that PRId64 (a) exists at all,
and (b) is /required/ to exist?
An *existence* proof is that it exists in gcc 3.2.2 (and probably
beyond),
certainly in gcc 4.0.1 on OS-X (you may choose to just believe me
on that).
Um, sorry. I meant an existence proof based on the Standard - i.e. a
demonstration that the Standard specifically caters for an
implementation creating such a macro (along the same lines as the
Standard catering for an implementation providing uint24_t without
requiring it to do so). Having said that, however, see below!
I believe that this makes it widely, though not universally,
portable.
No, I can't interpret Sect 7.8.1 to read that it /must/ exist.
Neither can I. (So much for "portable".) But re-reading that section
more carefully, I belatedly realise that the Standard does say that
N is to be replaced by a type width, so yes, at least I can now
agree that PRId64 /can/ exist.
For maximum portability, however, it should be avoided.
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
.
- Follow-Ups:
- Re: print 64bit-integer
- From: William Ahern
- Re: print 64bit-integer
- From: Chris McDonald
- Re: print 64bit-integer
- References:
- Re: print 64bit-integer
- From: Richard Heathfield
- Re: print 64bit-integer
- From: Chris McDonald
- Re: print 64bit-integer
- From: Richard Heathfield
- Re: print 64bit-integer
- From: Chris McDonald
- Re: print 64bit-integer
- Prev by Date: Re: anyone has the exercise manual to K&G 2nd edition?
- Next by Date: Re: anyone has the exercise manual to K&G 2nd edition?
- Previous by thread: Re: print 64bit-integer
- Next by thread: Re: print 64bit-integer
- Index(es):
Relevant Pages
|