]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Add format attribute to error handling methods.
authorBruno Haible <bruno@clisp.org>
Mon, 23 Oct 2006 11:21:15 +0000 (11:21 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:14:11 +0000 (12:14 +0200)
gettext-tools/libgettextpo/ChangeLog
gettext-tools/libgettextpo/gettext-po.c
gettext-tools/libgettextpo/gettext-po.h.in

index ef310513ad041ef597d18d19bb2e52fafe015eeb..15b69111b71211ae9bffed44cfd596fd1472d502 100644 (file)
@@ -1,3 +1,9 @@
+2006-10-21  Bruno Haible  <bruno@clisp.org>
+
+       * gettext-po.h.in (struct po_error_handler): Add format attribute to
+       error, error_at_line fields.
+       * gettext-po.c (po_error_logger): Declare with format attribute.
+
 2006-10-20  Bruno Haible  <bruno@clisp.org>
 
        * Makefile.am (config.h): Treat .lo files like .o files. Define
index e23f6863ef7bedca4f3417d5477a061b0db16f96..0dc287914338b3000d1652d04e0f9d62a9ac4598 100644 (file)
@@ -1227,6 +1227,9 @@ po_message_check_format (po_message_t message, po_xerror_handler_t handler)
 
 /* An error logger based on the po_error function pointer.  */
 static void
+po_error_logger (const char *format, ...)
+     __attribute__ ((__format__ (__printf__, 1, 2)));
+static void
 po_error_logger (const char *format, ...)
 {
   va_list args;
index ada8ad69f337c44a5a541b61e613e45d4fbdbd9d..b0e710fdfb666cf9366f5c7c296b05194e25869d 100644 (file)
@@ -55,7 +55,11 @@ struct po_error_handler
      Must increment the error_message_count variable declared in error.h.
      Must not return if STATUS is nonzero.  */
   void (*error) (int status, int errnum,
-                const char *format, ...);
+                const char *format, ...)
+#if ((__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3) && !__STRICT_ANSI__
+  __attribute__ ((__format__ (__printf__, 3, 4)))
+#endif
+  ;
 
   /* Signal an error.  The error message is built from FORMAT and the following
      arguments.  The error location is at FILENAME line LINENO. ERRNUM, if
@@ -64,7 +68,11 @@ struct po_error_handler
      Must not return if STATUS is nonzero.  */
   void (*error_at_line) (int status, int errnum,
                         const char *filename, unsigned int lineno,
-                        const char *format, ...);
+                        const char *format, ...)
+#if ((__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3) && !__STRICT_ANSI__
+  __attribute__ ((__format__ (__printf__, 5, 6)))
+#endif
+  ;
 
   /* Signal a multiline warning.  The PREFIX applies to all lines of the
      MESSAGE.  Free the PREFIX and MESSAGE when done.  */