From patchwork Mon Sep 8 01:36:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos O'Donell X-Patchwork-Id: 2671 Received: (qmail 23859 invoked by alias); 8 Sep 2014 01:36:11 -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 23845 invoked by uid 89); 8 Sep 2014 01:36:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.5 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Message-ID: <540D0803.5030502@redhat.com> Date: Sun, 07 Sep 2014 21:36:03 -0400 From: "Carlos O'Donell" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 MIME-Version: 1.0 To: GNU C Library Subject: In debug/tst-chk1 we purposely test gets and getwd? It seems in debug/tst-chk1.c we purposely test gets and getwd, but both of those trigger deprecation warnings. It would be nice to eventually turn on -Werror. To fix the warnings for debug/tstk-chk1.c would we use something like this? --- I haven't checked what version of gcc added these pragmas though, so I don't know what build version of gcc we'd have to bump up to. I'm just looking at the long term picture. Cheers, Carlos. diff --git a/debug/tst-chk1.c b/debug/tst-chk1.c index 3393153..2262cc4 100644 --- a/debug/tst-chk1.c +++ b/debug/tst-chk1.c @@ -730,6 +730,9 @@ do_test (void) exit (1); } + /* We purposely test gets, so ignore the warnings. */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" if (gets (buf) != buf || memcmp (buf, "abcdefgh", 9)) FAIL (); if (gets (buf) != buf || memcmp (buf, "ABCDEFGHI", 10)) @@ -741,6 +744,7 @@ do_test (void) FAIL (); CHK_FAIL_END #endif +#pragma GCC diagnostic pop rewind (stdin); @@ -1144,6 +1148,9 @@ do_test (void) CHK_FAIL_END #endif + /* We purposely test getwd, so ignore the warnings. */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" if (getwd (getcwdbuf) != getcwdbuf || strcmp (getcwdbuf, fname) != 0) FAIL (); @@ -1158,6 +1165,7 @@ do_test (void) FAIL (); CHK_FAIL_END #endif +#pragma GCC diagnostic pop } if (chdir (cwd1) != 0)