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]

[gfortran,patch] Handle "%3$d"-style format specifiers in error.c


Hi all,

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?


:ADDPATCH fortran:


Attachment: error.diff
Description: Binary data


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