From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30586 invoked by alias); 23 Oct 2007 17:10:41 -0000 Received: (qmail 30578 invoked by uid 22791); 23 Oct 2007 17:10:40 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate3.de.ibm.com (HELO mtagate3.de.ibm.com) (195.212.29.152) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 23 Oct 2007 17:10:33 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate3.de.ibm.com (8.13.8/8.13.8) with ESMTP id l9NHAVkR028460 for ; Tue, 23 Oct 2007 17:10:31 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.5) with ESMTP id l9NHAUQV1982508 for ; Tue, 23 Oct 2007 19:10:30 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l9NHAUns006567 for ; Tue, 23 Oct 2007 19:10:30 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id l9NHAUtT006558; Tue, 23 Oct 2007 19:10:30 +0200 Message-Id: <200710231710.l9NHAUtT006558@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Tue, 23 Oct 2007 19:10:30 +0200 Subject: Re: Avoid gcc warning on sparc solaris 9 To: pedro_alves@portugalmail.pt (Pedro Alves) Date: Tue, 23 Oct 2007 17:56:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <4053daab0710230924o386935aer31a1a2fb4f70da31@mail.gmail.com> from "Pedro Alves" at Oct 23, 2007 05:24:11 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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: 2007-10/txt/msg00543.txt.bz2 Pedro Alves wrote: > Building HEAD on a native gdb on sparc solaris 9 with gcc 3.4.6 stops due to: > > ../../src/gdb/sol-thread.c: In function `sol_thread_fetch_registers': > ../../src/gdb/sol-thread.c:533: warning: dereferencing type-punned > pointer will break strict-aliasing rules We've seen this on other platforms with gcc 3.4 as well. I think the best fix would be replace the problematic construct supply_gregset (regcache, (const gdb_gregset_t *) &gregset); with gdb_gregset_t *gregset_p = &gregset; supply_gregset (regcache, (const gdb_gregset_t *) gregset_p); That seemed to fix the problems e.g. in i386-linux-nat.c (fetch_regs). Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com