[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] xgettext: make c-format guessing slightly more intelligent.
From: |
Bruno Haible |
Subject: |
Re: [PATCH] xgettext: make c-format guessing slightly more intelligent. |
Date: |
Tue, 10 Jul 2001 22:18:06 +0200 (CEST) |
Gaute B Strokkenes writes:
>
> The current xgettext will guess that a string such as
>
> const char s[] = N_("50% is one half");
>
> is a printf-like format string, which I found somewhat surprising.
A workaround for this is found in the gettext documentation, section
"Special Comments preceding Keywords". Namely, use
xgettext:no-c-format in a comment preceding that line.
> After some digging, I found out that this is because a space actually
> has a well-defined meaning in this context; but only if a
> floating-point value is being printed
This is not true. A space is meaningful for "signed conversions", and
%i is one of them. See ISO C 99 section 7.19.6.1.
> One aber is that I'm not sure if I ought to check for PA_FLOAT as
> well. The glibc manual mentions it, but it's never set in
> parse_one_spec().
It's not needed because printf being a varargs function, all 'float'
arguments are automatically converted to 'double' before the printf
function is called.
Bruno