From: Pedro Alves <palves@redhat.com>
To: Sergio Durigan Junior <sergiodj@redhat.com>,
Steve Ellcey <sellcey@imgtec.com>
Cc: jose.marchesi@oracle.com, gdb-patches@sourceware.org
Subject: Re: Build failure with probe patch
Date: Thu, 19 Feb 2015 10:43:00 -0000 [thread overview]
Message-ID: <54E5BE22.4010705@redhat.com> (raw)
In-Reply-To: <87wq3ercw0.fsf@redhat.com>
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:
>
> <http://gdb-build.sergiodj.net/waterfall>
>
>> 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:
>
> <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41874>
>
> 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
prev parent reply other threads:[~2015-02-19 10:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-18 17:51 Steve Ellcey
2015-02-18 23:58 ` Sergio Durigan Junior
2015-02-19 0:48 ` Steve Ellcey
2015-02-19 4:39 ` Sergio Durigan Junior
2015-02-19 15:55 ` Jose E. Marchesi
2015-02-19 16:53 ` Pedro Alves
2015-02-19 17:32 ` Jose E. Marchesi
2015-02-19 17:48 ` Steve Ellcey
2015-02-19 20:41 ` Jose E. Marchesi
2015-02-19 21:18 ` Sergio Durigan Junior
2015-02-19 21:48 ` Steve Ellcey
2015-02-19 21:52 ` Sergio Durigan Junior
2015-02-19 21:59 ` Steve Ellcey
2015-02-19 18:30 ` Pedro Alves
2015-02-19 20:11 ` Jose E. Marchesi
2015-02-19 10:43 ` Pedro Alves [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54E5BE22.4010705@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=jose.marchesi@oracle.com \
--cc=sellcey@imgtec.com \
--cc=sergiodj@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox