From patchwork Wed Nov 26 17:59:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 3952 Received: (qmail 29555 invoked by alias); 26 Nov 2014 17:59:40 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 29545 invoked by uid 89); 26 Nov 2014 17:59:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SUBJ_OBFU_PUNCT_MANY autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Date: Wed, 26 Nov 2014 17:59:34 +0000 From: Joseph Myers To: Subject: Disable -Wdeprecated-declarations for register_printf_function calls in tst-printfsz.c Message-ID: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 This patch, relative to a tree with (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 * stdio-common/tst-printfsz.c: Include . (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 #include #include +#include #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",