This is the mail archive of the
mailing list for the GCC project.
[gfortran,patch] Handle "%3$d"-style format specifiers in error.c
- From: FX Coudert <fxcoudert at gmail dot com>
- To: "fortran at gcc dot gnu dot org List" <fortran at gcc dot gnu dot org>, gcc-patches patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 19 Nov 2006 20:03:42 +0100
- Subject: [gfortran,patch] Handle "%3$d"-style format specifiers in error.c
Attached patch makes fortran/error.c handle printf specifiers like %3
$d, which is used by translators to change the order in which the
format items appear (man 3 printf for details). Currently, we ICE on
such occurences (there are such occurences in existing translation
files). The fix I chose is to parse the format string multiple times,
and converting the items in the right order by va_arg.
Bootstrapped and regtested for x86_64-linux, and tested for exisiting
such cases in po files by Tobias Burnus (thanks Tobias!). OK for
mainline? I'd also like to backport this to 4.2 (this part of the
front-end is unchanged) because there already are such cases in the
translations files, and we need to stop the spread of these ICEs. (I
don't think it's worth the trouble of a 4.1 backport, however.) So,
OK for 4.2?
Description: Binary data