From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24096 invoked by alias); 19 Feb 2015 10:43:57 -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 24085 invoked by uid 89); 19 Feb 2015 10:43:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 19 Feb 2015 10:43:55 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1JAgjmJ001816 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 19 Feb 2015 05:42:45 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t1JAghrt024224; Thu, 19 Feb 2015 05:42:43 -0500 Message-ID: <54E5BE22.4010705@redhat.com> Date: Thu, 19 Feb 2015 10:43:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Sergio Durigan Junior , Steve Ellcey CC: jose.marchesi@oracle.com, gdb-patches@sourceware.org Subject: Re: Build failure with probe patch References: <87wq3ercw0.fsf@redhat.com> In-Reply-To: <87wq3ercw0.fsf@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-02/txt/msg00520.txt.bz2 On 02/18/2015 11:57 PM, Sergio Durigan Junior wrote: > On Wednesday, February 18 2015, Steve Ellcey wrote: > >> Is anyone else seeing this error when building the top-of-tree gdb: >> >> >> cc1: warnings being treated as errors >> /scratch/sellcey/gdb-bug/src/gdb/gdb/dtrace-probe.c: In function 'dtrace_get_probes': >> /scratch/sellcey/gdb-bug/src/gdb/gdb/dtrace-probe.c:624: warning: dereferencing type-punned pointer will break strict-aliasing rules >> make[1]: *** [dtrace-probe.o] Error 1 > > Thanks for your report. > > I don't see anything like this in any of our builders here: > > > >> I get this when building gdb on a CentOS 5 system with GCC 4.1.2 but I do not >> see it when building on a Ubuntu 12.04 system with GCC 4.6.3. I am not sure >> if this is due to the old GCC or if it is a legitimate error. > > According to: > > > > This warning has been removed from GCC. And by looking at the code > referenced by it, I don't see anything wrong there. So I'd say you can > ignore this (and probably update your GCC). > Actually, the code in that GCC bug is valid (char can alias anything), but the GDB code being warned about is invalid (C99/N1256, 6.5/7) - the dtrace code is aliasing pointers of incompatible types. See: https://gcc.gnu.org/ml/gcc-help/2013-03/msg00118.html I fixed up all similar cases I found in the GDB codebase a while ago: https://sourceware.org/ml/gdb-patches/2013-03/msg00449.html https://sourceware.org/ml/gdb-patches/2013-03/msg00578.html Compiling with -Wstrict-aliasing=1 shows that dtrace-probe.c warning with recent GCC's too, but then again, it also dumps a truckload of false positives. Thanks, Pedro Alves