This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Build regression on RHEL-5 [Re: [COMMIT PATCH] target.c: fix -Wpointer-sign]


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]