From patchwork Thu Feb 25 19:00:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Ellcey X-Patchwork-Id: 11091 Received: (qmail 120817 invoked by alias); 25 Feb 2016 19:01:00 -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 120803 invoked by uid 89); 25 Feb 2016 19:00:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 spammy=__asm, conftest.c, UD:conftest.c, conftestc X-HELO: mailapp01.imgtec.com Message-ID: <1456426851.29579.234.camel@ubuntu-sellcey> Subject: Re: [Patch] Fix glibc testing with GCC 4.9 compiler From: Steve Ellcey Reply-To: To: Florian Weimer , "Joseph S. Myers" CC: Date: Thu, 25 Feb 2016 11:00:51 -0800 In-Reply-To: <878u283e9i.fsf@mid.deneb.enyo.de> References: <68cad408-de62-4515-98ee-987574823403@BAMAIL02.ba.imgtec.org> <87fuwg3fcb.fsf@mid.deneb.enyo.de> <1456419316.29579.219.camel@ubuntu-sellcey> <878u283e9i.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 On Thu, 2016-02-25 at 18:12 +0100, Florian Weimer wrote: > I think this would need a configure check for detection because you > can't infer it from the reported compiler version. So would something like this be acceptable? I haven't fully tested it, I just want to see if this approach is OK. Steve Ellcey sellcey@imgtec.com diff --git a/configure.ac b/configure.ac index 3c766b7..674f05a 100644 --- a/configure.ac +++ b/configure.ac @@ -1449,6 +1449,13 @@ if test "$libc_cv_gcc_builtin_memset" = yes ; then AC_DEFINE(HAVE_BUILTIN_MEMSET) fi +AC_CACHE_CHECK(for -Wmemset-transposed-args, libc_cv_memset_warning, [dnl +LIBC_TRY_CC_OPTION([-Wmemset-transposed-args], [libc_cv_memset_warning=yes], [libc_cv_memset_warning=no]) +]) +if test "$libc_cv_memset_warning" = yes ; then + AC_DEFINE(HAVE_MEMSET_WARNING) +fi + AC_CACHE_CHECK(for redirection of built-in functions, libc_cv_gcc_builtin_redirection, [dnl cat > conftest.c <<\EOF extern char *strstr (const char *, const char *) __asm ("my_strstr"); diff --git a/string/tester.c b/string/tester.c index 7c36591..1659693 100644 --- a/string/tester.c +++ b/string/tester.c @@ -1305,7 +1305,7 @@ test_memset (void) equal(one, "axxxefgh", 2); /* Basic test. */ DIAG_PUSH_NEEDS_COMMENT; -#if __GNUC_PREREQ (5, 0) +#ifdef HAVE_MEMSET_WARNING /* GCC 5.0 warns about a zero-length memset because the arguments to memset may be in the wrong order. But we really want to test this. */ DIAG_IGNORE_NEEDS_COMMENT (5.0, "-Wmemset-transposed-args")