-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [adding bug-gnulib]
According to Stéphane Raimbault on 3/15/2009 5:09 AM: > Yes, it's a nice and easy solution but I've already tried to use %5b > without success on my system: > gcc 4.3.2 > glibc 2.8 (may 2008) > > gcc complains > warning: field width used with ‘%b’ strftime format This warning should be reported as a gcc QoI issue, now that POSIX 2008 has added field width as mandatory to strftime. But on further reading, I see that: http://www.opengroup.org/onlinepubs/9699919799/functions/strftime.html "The results are unspecified if more than one flag character is specified, a flag character is specified without a minimum field width; a minimum field width is specified without a flag character; a modifier is specified with a flag or with a minimum field width; 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; it is only a bug if gcc also issues the warning on one of the four required specifiers. > And the output doesn't have extra spacing when the string contains a > French accent (bug spotted?): > LC_TIME in french: > Month:|juil.| > Month:|août| Hmm. POSIX talks about field width being interpreted as byte spacing, not character spacing ("If the converted value... has fewer bytes than the minimum field width..., the output shall be padded on the left"). But on the other hand, it only talks about field width for four fields that are solely numeric, which means it is implementation- (and locale-) defined how width behaves on other specifiers. So yes, I think it would be a nice patch to teach GNU strftime to honor LC_CTYPE string width, and do character padding rather than byte padding. But, since gnulib shares its strftime implementation with glibc, you may want to file an upstream bug with glibc first to gauge whether this has a chance of being accepted. - -- 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 iEYEARECAAYFAknBtSkACgkQ84KuGfSFAYCeZQCgmSZj3QwqxkGgbTKh7fA4jO8Q b5IAnjl9U+Gbi0T4oHmNYev/Zd0v4idm =S5g8 -----END PGP SIGNATURE-----