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 string printf, scanf, strftime or strfmon style function , modifies (for example, translate language), result can passed printf, scanf, strftime or strfmon style function (with remaining arguments format function same have been unmodified string).

not sure why gettext doesn't use this, if doesn't.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -