-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Bruno Haible on 3/19/2009 5:45 AM: > Eric Blake wrote: >> "The results are unspecified ... or if a minimum field width is >> specified for any conversion specifier other than C , F , G , or Y ." >> >> So I guess the gcc warning is nice if you are being portable to non-GNU >> strftime > > And also with GNU strftime, the width feature is useless here: %5b will ensure > that the result occupies 5 _bytes_, not 5 screen columns. POSIX says: > "If the converted value ... has fewer bytes than the minimum field width > ... the output shall be padded ..."
But that's my point - POSIX _only_ specifies bytes for the four numeric-only fields C, F, G, and Y, where byte and screen width are identical (regardless of your locale, numbers should always be one byte per column). It specifically states that results are unspecified for other things, like %b, where there could be more bytes than screen columns. Which means we should be free to interpret things in the way that makes the most sense, by interpreting %5b as five screen columns rather than 5 bytes. - -- Don't work too hard, make some time for fun as well! Eric Blake e...@byu.net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAknCMuMACgkQ84KuGfSFAYCukQCgp4UCMLPIUqFGCBVNSMFPzu7Y I94AoI+uVG9PADvVvihS8RaCRtO+1ej/ =4H0m -----END PGP SIGNATURE-----