This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: printf_size broken?


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


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