From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30130 invoked by alias); 10 Mar 2013 19:45:30 -0000 Received: (qmail 30121 invoked by uid 22791); 10 Mar 2013 19:45:30 -0000 X-SWARE-Spam-Status: No, hits=-5.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-wg0-f49.google.com (HELO mail-wg0-f49.google.com) (74.125.82.49) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 10 Mar 2013 19:45:25 +0000 Received: by mail-wg0-f49.google.com with SMTP id 15so4395819wgd.16 for ; Sun, 10 Mar 2013 12:45:24 -0700 (PDT) X-Received: by 10.180.87.129 with SMTP id ay1mr8577497wib.1.1362944724201; Sun, 10 Mar 2013 12:45:24 -0700 (PDT) Received: from [192.168.0.102] (bl22-166-221.dsl.telepac.pt. [2.83.166.221]) by mx.google.com with ESMTPS id n2sm4086344wiy.6.2013.03.10.12.45.22 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 10 Mar 2013 12:45:23 -0700 (PDT) Message-ID: <513CE2D1.9040907@gmail.com> Date: Sun, 10 Mar 2013 19:45:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130219 Thunderbird/17.0.3 MIME-Version: 1.0 To: Jan Kratochvil CC: Pedro Alves , gdb-patches@sourceware.org Subject: Re: Build regression on RHEL-5 [Re: [COMMIT PATCH] target.c: fix -Wpointer-sign] References: <20130307235401.23019.61535.stgit@brno.lan> <20130310185522.GA16079@host2.jankratochvil.net> In-Reply-To: <20130310185522.GA16079@host2.jankratochvil.net> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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 X-SW-Source: 2013-03/txt/msg00431.txt.bz2 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 >> >> * 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 (¤t_target, TARGET_OBJECT_AVR, "avr.io_reg", &buf); c = (char *) buf; -- Pedro Alves