00db10
commit 0f88636c09686b1f8e876bfa88b40bacbcae8c11
00db10
Author: Joseph Myers <joseph@codesourcery.com>
00db10
Date:   Wed Dec 10 00:44:54 2014 +0000
00db10
00db10
    Disable -Wdeprecated-declarations for register_printf_function calls in tst-printfsz.c.
00db10
    
00db10
    This patch uses diagnostic control pragmas to disable warnings in
00db10
    stdio-common/tst-printfsz.c for use of the deprecated
00db10
    register_printf_function.  Because this test is testing printf_size
00db10
    and printf_size_info, and the latter has the interface expected for
00db10
    register_printf_function instead of the newer
00db10
    register_printf_specifier, it seems correct for this test to use the
00db10
    deprecated interface (wrapping printf_size_info in some way to use
00db10
    register_printf_specifier would seem an excessive change to what's
00db10
    tested).
00db10
    
00db10
    Tested for x86_64.
00db10
    
00db10
            * stdio-common/tst-printfsz.c: Include <libc-internal.h>.
00db10
            (main): Disable -Wdeprecated-declarations around calls to
00db10
            register_printf_function.
00db10
00db10
diff --git a/stdio-common/tst-printfsz.c b/stdio-common/tst-printfsz.c
00db10
index 5925050b59e90b79..74d67d2f694f344b 100644
00db10
--- a/stdio-common/tst-printfsz.c
00db10
+++ b/stdio-common/tst-printfsz.c
00db10
@@ -2,6 +2,7 @@
00db10
 #include <printf.h>
00db10
 #include <stdio.h>
00db10
 #include <string.h>
00db10
+#include <libc-internal.h>
00db10
 
00db10
 #define V       12345678.12345678
00db10
 
00db10
@@ -12,9 +13,15 @@ main (int argc, char *argv[])
00db10
   char buf[1024];
00db10
   int result = 0;
00db10
 
00db10
+  /* Testing printf_size_info requires using the deprecated
00db10
+     register_printf_function, resulting in warnings
00db10
+     "'register_printf_function' is deprecated".  */
00db10
+  DIAG_PUSH_NEEDS_COMMENT;
00db10
+  DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wdeprecated-declarations");
00db10
   /* Register the printf handlers.  */
00db10
   register_printf_function ('b', printf_size, printf_size_info);
00db10
   register_printf_function ('B', printf_size, printf_size_info);
00db10
+  DIAG_POP_NEEDS_COMMENT;
00db10
 
00db10
 
00db10
   sprintf (buf, "%g %b %B %.0b %.0B %.1b %.1B %8.0b %08.0B",