This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Preparsing sprintf format strings
On 2007-10-10, Heikki Linnakangas <heikki@enterprisedb.com> wrote:
> The only features in the printf-family of functions that depends on the
> locale are the conversion with thousand grouping ("%'d"), and glibc
> extension of using locale's alternative output digits ("%Id").
And those dealing with floating point values ("%f", "%g", etc) - for
example, this program:
#include <locale.h>
#include <stdio.h>
int main() {
printf("%f\n", 3.14);
setlocale(LC_NUMERIC, "fr_FR");
printf("%f\n", 3.14);
return 0;
}
produces this output:
3.140000
3,140000
> We can easily just fall back to glibc sprintf in those cases.
And for these others too, of course.
Cheers,
Olly