]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Add missing format_arg attribute to check that printf with translated
authorVladimir Serbinenko <phcoder@gmail.com>
Tue, 17 Dec 2013 15:42:01 +0000 (16:42 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Tue, 17 Dec 2013 15:42:01 +0000 (16:42 +0100)
messages has proper arguments.

ChangeLog
include/grub/i18n.h

index 745664b6709058bdcd0975d174f66e090becf691..dcc002fe209f3fc34080fd242e7aebac370275d2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-12-17  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       Add missing format_arg attribute to check that printf with translated
+       messages has proper arguments.
+
 2013-12-17  Vladimir Serbinenko  <phcoder@gmail.com>
 
        Use grub_xasprintf to format translated error messages containing
index a91d73346e45c947a46fab27b95ed7617a8f12b8..468602d926d3e6fd113dfb07856e838bdecfd85b 100644 (file)
@@ -25,7 +25,7 @@
 /* NLS can be disabled through the configure --disable-nls option.  */
 #if (defined(ENABLE_NLS) && ENABLE_NLS) || !defined (GRUB_UTIL)
 
-extern const char *(*EXPORT_VAR(grub_gettext)) (const char *s);
+extern const char *(*EXPORT_VAR(grub_gettext)) (const char *s) __attribute__ ((format_arg (1)));
 
 # ifdef GRUB_UTIL
 
@@ -41,7 +41,7 @@ extern const char *(*EXPORT_VAR(grub_gettext)) (const char *s);
    for invalid uses of the value returned from these functions.
    On pre-ANSI systems without 'const', the config.h file is supposed to
    contain "#define const".  */
-static inline const char * __attribute__ ((always_inline))
+static inline const char * __attribute__ ((always_inline,format_arg (1)))
 gettext (const char *str)
 {
   return str;
@@ -50,13 +50,13 @@ gettext (const char *str)
 #endif /* (defined(ENABLE_NLS) && ENABLE_NLS) */
 
 #ifdef GRUB_UTIL
-static inline const char * __attribute__ ((always_inline))
+static inline const char * __attribute__ ((always_inline,format_arg (1)))
 _ (const char *str)
 {
   return gettext(str);
 }
 #else
-static inline const char * __attribute__ ((always_inline))
+static inline const char * __attribute__ ((always_inline,format_arg (1)))
 _ (const char *str)
 {
   return grub_gettext(str);