From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25969 invoked by alias); 19 Sep 2016 11:47:34 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 25379 invoked by uid 89); 19 Sep 2016 11:47:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=msgid, H*r:500, sk:ulrich, sk:ulrich. X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 19 Sep 2016 11:47:31 +0000 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u8JBi0sm075427 for ; Mon, 19 Sep 2016 07:47:29 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0b-001b2d01.pphosted.com with ESMTP id 25gyf3jydj-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 19 Sep 2016 07:47:29 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 19 Sep 2016 12:47:27 +0100 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 19 Sep 2016 12:47:26 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id A6D4A17D805F for ; Mon, 19 Sep 2016 12:49:23 +0100 (BST) Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u8JBlPEF15335816 for ; Mon, 19 Sep 2016 11:47:25 GMT Received: from d06av04.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u8JBlP0C031839 for ; Mon, 19 Sep 2016 05:47:25 -0600 Received: from oc8523832656.ibm.com (dyn-9-152-213-149.boeblingen.de.ibm.com [9.152.213.149]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u8JBlO4E031834; Mon, 19 Sep 2016 05:47:25 -0600 Received: by oc8523832656.ibm.com (Postfix, from userid 500) id A00EC10B7EF; Mon, 19 Sep 2016 13:47:24 +0200 (CEST) Subject: Re: [PATCH] gdb: Use std::max and std::min throughout To: palves@redhat.com (Pedro Alves) Date: Mon, 19 Sep 2016 11:47:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <77416303-1ed7-fe71-7a52-1dbd1ca6aa56@redhat.com> from "Pedro Alves" at Sep 16, 2016 08:00:59 PM MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16091911-0028-0000-0000-0000021EBCD3 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16091911-0029-0000-0000-0000207EBAA1 Message-Id: <20160919114724.A00EC10B7EF@oc8523832656.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-09-19_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609020000 definitions=main-1609190163 X-SW-Source: 2016-09/txt/msg00203.txt.bz2 Pedro Alves wrote: > gdb/ChangeLog: > 2016-09-16 Pedro Alves > > * defs.h (min, max): Delete. > * aarch64-tdep.c: Include and use std::min and > std::max throughout. This causes build failures on many files on my SPU daily build. This may be related to the fact that I'm using --disable-nls and/or that I'm building on RHEL 5 using a GCC 4.1 host compiler. The symptom is: /usr/include/libintl.h:40: error: expected unqualified-id before ‘const’ /usr/include/libintl.h:40: error: expected `)' before ‘const’ /usr/include/libintl.h:40: error: expected initializer before ‘const’ /usr/include/libintl.h:45: error: expected unqualified-id before ‘const’ /usr/include/libintl.h:45: error: expected `)' before ‘const’ /usr/include/libintl.h:45: error: expected initializer before ‘const’ /usr/include/libintl.h:52: error: expected unqualified-id before ‘const’ /usr/include/libintl.h:52: error: expected `)' before ‘const’ /usr/include/libintl.h:52: error: expected initializer before ‘const’ /usr/include/libintl.h:83: error: expected unqualified-id before ‘while’ /usr/include/libintl.h:83: error: expected initializer before ‘while’ /usr/include/libintl.h:87: error: expected unqualified-id before ‘while’ /usr/include/libintl.h:87: error: expected initializer before ‘while’ Line 40 in this header is originally: extern char *gettext (__const char *__msgid) __THROW __attribute_format_arg__ (1); but after preprocessing we get: extern char *(__const char *__msgid) throw () __attribute__ ((__format_arg__ (1))); which is obviously broken. It seems the reason for this is a GDB header trick in common/gdb_locale.h: #ifdef ENABLE_NLS ... #else # define gettext(Msgid) (Msgid) ... #endif This will obviously cause problems if the header is included at any point after "gdb_locale.h" (which is in turn included by "defs.h" via "common-defs.h", and thus by any GDB file). Apparently in the past this newer happened. But after your change to include , this is now triggered, since (at least the GCC 4.1 copy of) includes via , , and . Any thoughts how to fix this? Bye, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com