This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Checking format specifiers (Was: Re: Support for %d$c format specifier in diagnostics.c)


Wolfgang Bangerth wrote:
> 
> Hi Chiaki,
> I think it's excellent someone finally looks at positional arguments for
> printf! gcc has repeatedly been bitten by the following problem: there's a
> message like
>   Variable %s doesn't exist in class %T
> (or so, don't know whether the format specifiers make sens, just assume
> they're different), and some translation reads
>   In der Klasse %T gibt es keine Variable %s

Thank you for the encouraging word, and the example(s) here
and at the URLs you mention.

I followed the discussion that started with this thread and
 - will check if the latest msgfmt is capable of checking many
   problems we encounter in the PO files, 
  (I don't believe they handle the GCC extension such as %T, %D, etc.
   but it is a start.).
 - will see if your script would help in conjunction with the msgfmt,

 - and will see also if the new format checker within GCC framework
   can be taught the extended format checking for positional parameter
   easily.

> I am not familiar with the translation community, but if you are: one of the
> really necessary additions in their processes would be a small program that
> does what my small script tried to do in a thourough way (i.e., for example,
> taking into account positional parameters). If we would then only get "valid"
> translations, we should add this script to our makefiles, so that no broken
> translations can be checked in unless they pass the script (could be done as
> a part of bootstrapping). Since you are already working on a parser for these
> things, writing a checker might (or might not) be a byproduct of your work,
> and one that would certainly be appreciated!

I believe I once was on a message translation project mailing list (not
an active member though), and so will try to find
out what checker these people use or what they think about
such a checker if they can use it. My guess is that they will
welcome such tools.

What form the format checker ends up with is anyone's guess.
It might be easier to instruct msgfmt to understand the
extended format characters, etc..

I will download the msgfmt source file from somewhere since
the local Debian GNU/Linux version is very much outdated, I think,
and doesn't have the --check-format option mentioned in the thread :-(


-- 
int main(void){int j=2003;/*(c)2003 cishikawa. */
char t[] ="<CI> @abcdefghijklmnopqrstuvwxyz.,\n\"";
char *i ="g>qtCIuqivb,gCwe\np@.ietCIuqi\"tqkvv is>dnamz";
while(*i)((j+=strchr(t,*i++)-(int)t),(j%=sizeof t-1),
(putchar(t[j])));return 0;}/* under GPL */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]