This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: `quad' printf format specifier ?
- To: Marc Espie <Marc dot Espie at liafa dot jussieu dot fr>
- Subject: Re: `quad' printf format specifier ?
- From: Zack Weinberg <zack at rabi dot columbia dot edu>
- Date: Sat, 06 Feb 1999 14:04:00 -0500
- cc: egcs at egcs dot cygnus dot com
On Sat, 6 Feb 1999 13:31:20 +0100, Marc Espie wrote:
>On Fri, Feb 05, 1999 at 08:55:28PM -0500, Zack Weinberg wrote:
>> 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?
>
>Warnings when using __attribute((format(printf,...))
>
>> (Note this is a libc issue, not a compiler issue, unless your problem is
>> with gcc's format checking.)
>
>Precisely...
>I probably wasn't clear enough in my message, wasn't I ?
It makes sense now. I can make a case for fixing gcc or for changing
your definition of quad_t:
- %qd is defined to print a 64 bit quantity, so if long is 64 bits,
then we shouldn't warn when %qd is used to print something with base
type long.
- but long isn't 64 bits everywhere, so portable code must use int64_t
and/or long long to get 64 bits reliably; therefore %qd and %lld
should warn when given something with base type long.
It really boils down to whether you think `long long' is an
abomination or not.
zw