This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: printf_size broken?
- From: Petter Reinholdtsen <pere at hungry dot com>
- To: libc-alpha at sources dot redhat dot com
- Date: 22 Jan 2004 16:47:13 +0100
- Subject: Re: printf_size broken?
- References: <hozncg48df.fsf@reger.suse.de>
- Reply-by: Tue, 1 Jan 1801 04:37:40 +1000
[Andreas Jaeger]
> I get a warning from GCC that width is used uninitialized. Looking at
> the code, this seems to be indeed the case:
>
> int width = info->prec > width ? info->prec : width;
>
> What is the intend of the code and how should it look correctly?
Looking in CVS, I suspect a search-repleace went wrong. This code was
commited 2000-02-11 by Ulrich with this message:
Truely support wide characater output.
Finally handle decimal points and thousands separator characters
correctly for multibyte output.
This was the relevant diff:
if (special)
{
- int width = info->prec > info->width ? info->prec : info->width;
+ int width = info->prec > width ? info->prec : width;
if (negative || info->showsign || info->space)
--width;
Other part of the dif is mentinioning 'wide' and 'info->wide'.
Perhaps related?