Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <alves.ped@gmail.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Pedro Alves <palves@redhat.com>, gdb-patches@sourceware.org
Subject: Re: Build regression on RHEL-5  [Re: [COMMIT PATCH] target.c: fix -Wpointer-sign]
Date: Sun, 10 Mar 2013 19:45:00 -0000	[thread overview]
Message-ID: <513CE2D1.9040907@gmail.com> (raw)
In-Reply-To: <20130310185522.GA16079@host2.jankratochvil.net>

On 03/10/2013 06:55 PM, Jan Kratochvil wrote:
> On Fri, 08 Mar 2013 00:54:01 +0100, Pedro Alves wrote:
>> gdb/
>> 2013-03-07  Pedro Alves  <palves@redhat.com>
>>
>> 	* target.c (target_read_stralloc, target_fileio_read_alloc):
>> 	*Cast pointer to 'gdb_byte *' in target call.
> 
> 53d2625aa5606dfd19ba3806eebeda54ce159f09
> 
> cc1: warnings being treated as errors
> target.c: In function ‘target_read_stralloc’:
> target.c:2370: warning: dereferencing type-punned pointer will break strict-aliasing rules
> target.c: In function ‘target_fileio_read_stralloc’:
> target.c:3534: warning: dereferencing type-punned pointer will break strict-aliasing rules
> 
> Tested on CentOS 5.9 x86_64 and i386.

Thanks.  I'm aware of this (though Fedora 17's gcc doesn't warn at all), and I'll fix it Monday.

http://gcc.gnu.org/ml/gcc-help/2013-03/msg00118.html

The fix will be doing things like:

gdb_byte *buf;
char *c;
...
bufsiz = target_read_alloc (&current_target, TARGET_OBJECT_AVR,
			    "avr.io_reg", &buf);
c = (char *) buf;

-- 
Pedro Alves


      reply	other threads:[~2013-03-10 19:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-07 23:54 [COMMIT PATCH] target.c: fix -Wpointer-sign Pedro Alves
2013-03-10 18:55 ` Build regression on RHEL-5 [Re: [COMMIT PATCH] target.c: fix -Wpointer-sign] Jan Kratochvil
2013-03-10 19:45   ` 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=513CE2D1.9040907@gmail.com \
    --to=alves.ped@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=palves@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