This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: `quad' printf format specifier ?


In message <199902060155.UAA00615@blastula.phys.columbia.edu>
	so spake Zack Weinberg (zack):

> 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?

On OpenBSD/alpha sizeof(long) == sizeof(long long) == 8.
However, giving the following code snippet:
    quad_t q = QUAD_MAX;
    printf("QUAD_MAX is %qd\n", q);
gcc -Wall produces:
    warning: long long int format, quad_t arg (arg 2)

quad_t is typedef'd thusly:
typedef long		int64_t;
typedef int64_t		quad_t;

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

Yes, it appears to be a format checking bug.

 - todd


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]