`quad' printf format specifier ?

Zack Weinberg zack@rabi.columbia.edu
Fri Feb 5 17:55:00 GMT 1999


On Sat, 6 Feb 1999 01:10:39 +0100, Marc Espie wrote:
>What is the exact status of the quad format specifier in printf ("qd"
>extension) ?
>
>As far as I know, it is intended to handle 64 bits comfortably on all
>machines, and was originally a bsd-ism (quad_t).
>
>However, egcs (and gcc before that) treats it as equivalent to ll, which
>is not always equivalent: openbsd-alpha is configured so that long is
>64 bits, and hence quad_t is typedef'ed to long.
>
>In that particular case, the printf-like attribute doesn't work as 
>intended.

If sizeof (long long) == sizeof (long) on openbsd-alpha, it should work
anyway - i.e. %ld, %lld, and %qd should be interchangeable.  What problems
are you seeing?

(Note this is a libc issue, not a compiler issue, unless your problem is
with gcc's format checking.)

zw


zw


More information about the Gcc-bugs mailing list