printf_size broken?
Petter Reinholdtsen
pere@hungry.com
Thu Jan 22 15:47:00 GMT 2004
[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?
More information about the Libc-alpha
mailing list