Incorrect warning about printf %0<fieldwidth>p format
Jim Avera
jima@cadence.com
Thu May 8 16:25:00 GMT 2003
The actual implementation in glibc does in
fact support a field width with %p, and gcc should
not prevent accessing this functionality.
If you insist on giving this warning by default, then
will you please provide a way (g++ switch, presumably)
which turns off this warning for people who are
using glibc and want to access this functionality?
I don't want to turn off all printf-fmt warnings, as
they are very valuable (when they diagnose code which
will not actually work).
On Thu, 2003-05-08 at 09:03, Falk Hueffner wrote:
> Jim Avera <jima@cadence.com> writes:
>
> > It actually says (and I think this is clear):
> > "If a precision is given with a numeric conversion
> > (d, i, o, u, x, and X), the 0 flag is ignored. For
> > other conversions, the behavior is undefined."
> >
> > We are not talking about *precision*, but *min field width*.
>
> No, we're not. We're talking about the '0' flag. The warning says:
>
> warning: `0' flag used with `%p' printf format
>
> And from the paragraph I quoted it is clear the the '0' flag is indeed
> not valid for a 'p' conversion.
>
> --
> Falk
>
More information about the Gcc-bugs
mailing list