c - Can gcc check printf formats when using gettext? -
gcc can check printf arguments match format given. works when argument printf liternal. , so, gcc needs know format.
now when code localized, it's format needs localizing. passed through gettext, isn't literal anymore , gcc can't check arguments match.
is there way tell gcc assume gettext
function returns it's argument purpose of check?
of course separate build disabled localization check, know whether there option during main compile.
that sounds gcc's format_arg
attribute designed do:
the
format_arg
attribute specifies function takes format stringprintf
,scanf
,strftime
orstrfmon
style function , modifies (for example, translate language), result can passedprintf
,scanf
,strftime
orstrfmon
style function (with remaining arguments format function same have been unmodified string).
not sure why gettext doesn't use this, if doesn't.
Comments
Post a Comment