public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* Disable -Wdeprecated-declarations for register_printf_function calls in tst-printfsz.c
@ 2014-11-26 17:59 Joseph Myers
  2014-12-02 19:27 ` Roland McGrath
  2014-12-06 23:16 ` Ondřej Bílka
  0 siblings, 2 replies; 4+ messages in thread
From: Joseph Myers @ 2014-11-26 17:59 UTC (permalink / raw)
  To: libc-alpha

This patch, relative to a tree with
<https://sourceware.org/ml/libc-alpha/2014-11/msg00736.html> (pending
review) applied, uses diagnostic control pragmas to disable warnings
in stdio-common/tst-printfsz.c for use of the deprecated
register_printf_function.  Because this test is testing printf_size
and printf_size_info, and the latter has the interface expected for
register_printf_function instead of the newer
register_printf_specifier, it seems correct for this test to use the
deprecated interface (wrapping printf_size_info in some way to use
register_printf_specifier would seem an excessive change to what's
tested).

Tested for x86_64.

2014-11-26  Joseph Myers  <joseph@codesourcery.com>

	* stdio-common/tst-printfsz.c: Include <libc-internal.h>.
	(main): Disable -Wdeprecated-declarations around calls to
	register_printf_function.

diff --git a/stdio-common/tst-printfsz.c b/stdio-common/tst-printfsz.c
index 5925050..74d67d2 100644
--- a/stdio-common/tst-printfsz.c
+++ b/stdio-common/tst-printfsz.c
@@ -2,6 +2,7 @@
 #include <printf.h>
 #include <stdio.h>
 #include <string.h>
+#include <libc-internal.h>
 
 #define V       12345678.12345678
 
@@ -12,9 +13,15 @@ main (int argc, char *argv[])
   char buf[1024];
   int result = 0;
 
+  /* Testing printf_size_info requires using the deprecated
+     register_printf_function, resulting in warnings
+     "'register_printf_function' is deprecated".  */
+  DIAG_PUSH_NEEDS_COMMENT;
+  DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wdeprecated-declarations");
   /* Register the printf handlers.  */
   register_printf_function ('b', printf_size, printf_size_info);
   register_printf_function ('B', printf_size, printf_size_info);
+  DIAG_POP_NEEDS_COMMENT;
 
 
   sprintf (buf, "%g %b %B %.0b %.0B %.1b %.1B %8.0b %08.0B",

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Disable -Wdeprecated-declarations for register_printf_function calls in tst-printfsz.c
  2014-11-26 17:59 Disable -Wdeprecated-declarations for register_printf_function calls in tst-printfsz.c Joseph Myers
@ 2014-12-02 19:27 ` Roland McGrath
  2014-12-06 23:16 ` Ondřej Bílka
  1 sibling, 0 replies; 4+ messages in thread
From: Roland McGrath @ 2014-12-02 19:27 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha

OK

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Disable -Wdeprecated-declarations for register_printf_function calls in tst-printfsz.c
  2014-11-26 17:59 Disable -Wdeprecated-declarations for register_printf_function calls in tst-printfsz.c Joseph Myers
  2014-12-02 19:27 ` Roland McGrath
@ 2014-12-06 23:16 ` Ondřej Bílka
  2014-12-06 23:38   ` Joseph Myers
  1 sibling, 1 reply; 4+ messages in thread
From: Ondřej Bílka @ 2014-12-06 23:16 UTC (permalink / raw)
  To: Joseph Myers; +Cc: libc-alpha


Just reminding you that it was acked by Roland, but it was not commited.

On Wed, Nov 26, 2014 at 05:59:34PM +0000, Joseph Myers wrote:
> This patch, relative to a tree with
> <https://sourceware.org/ml/libc-alpha/2014-11/msg00736.html> (pending
> review) applied, uses diagnostic control pragmas to disable warnings
> in stdio-common/tst-printfsz.c for use of the deprecated
> register_printf_function.  Because this test is testing printf_size
> and printf_size_info, and the latter has the interface expected for
> register_printf_function instead of the newer
> register_printf_specifier, it seems correct for this test to use the
> deprecated interface (wrapping printf_size_info in some way to use
> register_printf_specifier would seem an excessive change to what's
> tested).
> 
> Tested for x86_64.
> 
> 2014-11-26  Joseph Myers  <joseph@codesourcery.com>
> 
> 	* stdio-common/tst-printfsz.c: Include <libc-internal.h>.
> 	(main): Disable -Wdeprecated-declarations around calls to
> 	register_printf_function.
> 
> diff --git a/stdio-common/tst-printfsz.c b/stdio-common/tst-printfsz.c
> index 5925050..74d67d2 100644
> --- a/stdio-common/tst-printfsz.c
> +++ b/stdio-common/tst-printfsz.c
> @@ -2,6 +2,7 @@
>  #include <printf.h>
>  #include <stdio.h>
>  #include <string.h>
> +#include <libc-internal.h>
>  
>  #define V       12345678.12345678
>  
> @@ -12,9 +13,15 @@ main (int argc, char *argv[])
>    char buf[1024];
>    int result = 0;
>  
> +  /* Testing printf_size_info requires using the deprecated
> +     register_printf_function, resulting in warnings
> +     "'register_printf_function' is deprecated".  */
> +  DIAG_PUSH_NEEDS_COMMENT;
> +  DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wdeprecated-declarations");
>    /* Register the printf handlers.  */
>    register_printf_function ('b', printf_size, printf_size_info);
>    register_printf_function ('B', printf_size, printf_size_info);
> +  DIAG_POP_NEEDS_COMMENT;
>  
>  
>    sprintf (buf, "%g %b %B %.0b %.0B %.1b %.1B %8.0b %08.0B",
> 
> -- 
> Joseph S. Myers
> joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Disable -Wdeprecated-declarations for register_printf_function calls in tst-printfsz.c
  2014-12-06 23:16 ` Ondřej Bílka
@ 2014-12-06 23:38   ` Joseph Myers
  0 siblings, 0 replies; 4+ messages in thread
From: Joseph Myers @ 2014-12-06 23:38 UTC (permalink / raw)
  To: Ondřej Bílka; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 211 bytes --]

On Sun, 7 Dec 2014, Ondøej Bílka wrote:

> Just reminding you that it was acked by Roland, but it was not commited.

This patch depends on another unreviewed patch.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-12-06 23:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-26 17:59 Disable -Wdeprecated-declarations for register_printf_function calls in tst-printfsz.c Joseph Myers
2014-12-02 19:27 ` Roland McGrath
2014-12-06 23:16 ` Ondřej Bílka
2014-12-06 23:38   ` Joseph Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).