tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: top on machines with more than 9 CPUs

    Date:        Wed, 30 Jun 2010 12:40:27 +0200
    From:        Ignatios Souvatzis <>
    Message-ID:  <>

  | %0*d is supposed to work according to C99 and some C201x I stumbled upon,
  | so I don't think it's obsolete. What implementations do you suspect to
  | not implement '...%0*d",x,y)', but to implement '...%*.*d",x,x,y)' ?

Oh, sorry, haven't had time to read any netbsd e-mail for more than a
week, I didn't see your message until just recently...

I don't know of any that don't implement it (the most likely is probably the
no longer in any way relevant System III) - it was just that I recall being
told, years ago, that I was supposed to stop using the %0 method that was
in stdio from the start, and instead use the precision (which is admittedly
more general, as you can do %5.4d and stuff like that) to achieve zero fill.

If the C people have (if they ever actually needed to) woken up and actually
specified that %0 should work, then I am pleased indeed, and I can go back
to using it again, and in particular, I can stop doing the %05.5d trick to try
and ensure the right thing would happen whatever kind of printf existed.

The distinction between a literal width, and the '*' indirect form was
never the issue - I just mentioned the %0* as an unusual case that some
implementations may not have coded correctly - I expect my own printf
would have gotten that wrong, though you'll never see that (it didn't pretend
to be a standard C printf - it was for a small standalone environment, which
enabled stff like %i to mean IP (v4 of course, at the time) address, and
%e for ethernet address - obviously no float support at all...).  I just
thought that if I wrote code that didn't consider the possibility of %0*
then someone else might have as well (whereas %*.* is simple).


Home | Main Index | Thread Index | Old Index