From patchwork Tue Oct 18 22:19:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 16627 Received: (qmail 71393 invoked by alias); 18 Oct 2016 22:20:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 71377 invoked by uid 89); 18 Oct 2016 22:20:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Meanwhile, Hx-languages-length:4015, our X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 18 Oct 2016 22:19:52 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1FA3E4E4D9; Tue, 18 Oct 2016 22:19:51 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9IMJnUn030260; Tue, 18 Oct 2016 18:19:50 -0400 Subject: [pushed] gdb: no longer define __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS (Re: [PATCH] Update gnulib to current upstream master) To: Yao Qi References: <1476285429-24489-1-git-send-email-palves@redhat.com> <0d295a85-e43a-6b6c-aef1-7f61a9ef5704@redhat.com> Cc: "gdb-patches@sourceware.org" From: Pedro Alves Message-ID: Date: Tue, 18 Oct 2016 23:19:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <0d295a85-e43a-6b6c-aef1-7f61a9ef5704@redhat.com> On 10/12/2016 05:12 PM, Pedro Alves wrote: > On 10/12/2016 05:09 PM, Yao Qi wrote: >> On Wed, Oct 12, 2016 at 4:17 PM, Pedro Alves wrote: >>> I tried building gdb with G++ 4.7 and CXX="g++ -std=gnu+11", and that >>> tripped on a build error: >> >> GDB source requires C++03 compiler, but it should be built with recent >> compiler with recent C++ standard. >> >> Patch is good to me, but let us leave this patch here for one day or two >> for the purpose of collecting comments or objections. > > Related to C++11? That was that motivated the update this time, > but we should routinely update gnulib _anyway_. This allows reverting: > > commit e063da67902e2ba03cfc6f7381694f4c6a72ecf4 > Author: Pedro Alves > AuthorDate: Tue Nov 17 15:17:45 2015 +0000 > > [C++] Define __STDC_CONSTANT_MACROS / __STDC_LIMIT_MACROS for stdint.h > > for example, since my gnulib fix has gone into master > upstream meanwhile. I've pushed in the gnulib merge to master now. In addition, I've pushed in the following patch as well: From f6abaf7a4088dc9a5d73ee2233246347af9181d5 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Tue, 18 Oct 2016 20:48:37 +0100 Subject: [PATCH] gdb: no longer define __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS My gnulib fix at: https://lists.gnu.org/archive/html/bug-gnulib/2015-11/msg00010.html was merged upstream meanwhile and our gnulib copy now includes it. As a coincidence, Kevin was telling me today that these macros are causing a build problem on FreeBSD: common/common-defs.h:47:0: error: "__STDC_CONSTANT_MACROS" redefined [-Werror] #define __STDC_CONSTANT_MACROS 1 /usr/include/sys/cdefs.h:408:0: note: this is the location of the previous definition #define __STDC_CONSTANT_MACROS (and a similar error for __STDC_LIMIT_MACROS) The problem seems to be that we should be defining these input macros before including any system header, but, we're not. So let's just revert e063da67902e ([C++] Define __STDC_CONSTANT_MACROS / __STDC_LIMIT_MACROS for stdint.h). If this causes a problem somewhere, we can re-define the macros higher up in the file, before system headers are included. gdb/ChangeLog: 2016-10-18 Pedro Alves * common/common-defs.h (__STDC_CONSTANT_MACROS) (__STDC_LIMIT_MACROS): Delete. --- gdb/ChangeLog | 5 +++++ gdb/common/common-defs.h | 16 ---------------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7dd1b32..80215df 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2016-10-18 Pedro Alves + * common/common-defs.h (__STDC_CONSTANT_MACROS) + (__STDC_LIMIT_MACROS): Delete. + +2016-10-18 Pedro Alves + * gnulib/update-gnulib.sh (GNULIB_COMMIT_SHA1): Set to 2692e23a48e21f6daa029e8af9f1a143b7532f47. * gnulib/configure, gnulib/config.in, gnulib/aclocal.m4: diff --git a/gdb/common/common-defs.h b/gdb/common/common-defs.h index 5426dd5..9b5d853 100644 --- a/gdb/common/common-defs.h +++ b/gdb/common/common-defs.h @@ -31,23 +31,7 @@ #include #include #include - -/* From: - https://www.gnu.org/software/gnulib/manual/html_node/stdint_002eh.html - - "On some hosts that predate C++11, when using C++ one must define - __STDC_CONSTANT_MACROS to make visible the definitions of constant - macros such as INTMAX_C, and one must define __STDC_LIMIT_MACROS to - make visible the definitions of limit macros such as INTMAX_MAX." - - gnulib doesn't fix this for us correctly yet. See: - https://lists.gnu.org/archive/html/bug-gnulib/2015-11/msg00004.html - - Meanwhile, explicitly define these ourselves, as C99 intended. */ -#define __STDC_CONSTANT_MACROS 1 -#define __STDC_LIMIT_MACROS 1 #include - #include #ifdef HAVE_STRINGS_H #include /* for strcasecmp and strncasecmp */