From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4491 invoked by alias); 12 Jul 2008 20:24:07 -0000 Received: (qmail 4482 invoked by uid 22791); 12 Jul 2008 20:24:06 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate5.de.ibm.com (HELO mtagate5.de.ibm.com) (195.212.29.154) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 12 Jul 2008 20:23:45 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate5.de.ibm.com (8.13.8/8.13.8) with ESMTP id m6CKNg2A222226 for ; Sat, 12 Jul 2008 20:23:42 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 v9.0) with ESMTP id m6CKNgGj3665960 for ; Sat, 12 Jul 2008 22:23:42 +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 m6CKNfV6019194 for ; Sat, 12 Jul 2008 22:23:42 +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 m6CKNfDU019191; Sat, 12 Jul 2008 22:23:41 +0200 Message-Id: <200807122023.m6CKNfDU019191@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Sat, 12 Jul 2008 22:23:41 +0200 Subject: Re: [continuation args 2/2] Make continuation args not leak To: pedro@codesourcery.com (Pedro Alves) Date: Sat, 12 Jul 2008 20:24:00 -0000 From: "Ulrich Weigand" Cc: drow@false.org (Daniel Jacobowitz), gdb-patches@sourceware.org In-Reply-To: <200807122027.59292.pedro@codesourcery.com> from "Pedro Alves" at Jul 12, 2008 08:27:59 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: 2008-07/txt/msg00238.txt.bz2 Pedro Alves wrote: > Rewrite continuations internals on top of cleanups and plug > continuation arguments leaks. This breaks the build due to violation of the C aliasing rules: /home/uweigand/fsf/gdb-head/gdb/utils.c: In function 'add_continuation': /home/uweigand/fsf/gdb-head/gdb/utils.c:479: warning: dereferencing type-punned pointer will break strict-aliasing rules /home/uweigand/fsf/gdb-head/gdb/utils.c: In function 'discard_all_continuations': /home/uweigand/fsf/gdb-head/gdb/utils.c:518: warning: dereferencing type-punned pointer will break strict-aliasing rules /home/uweigand/fsf/gdb-head/gdb/utils.c: In function 'add_intermediate_continuation': /home/uweigand/fsf/gdb-head/gdb/utils.c:530: warning: dereferencing type-punned pointer will break strict-aliasing rules /home/uweigand/fsf/gdb-head/gdb/utils.c: In function 'discard_all_intermediate_continuations': /home/uweigand/fsf/gdb-head/gdb/utils.c:570: warning: dereferencing type-punned pointer will break strict-aliasing rules > + struct cleanup **as_cleanup_p = (struct cleanup **) &cmd_continuation; This may cause a "struct cleanup *" to alias with a "struct continuation *", which is not allowed according to the C standard. Why do we still have a "struct continuation" (as nowhere-defined type)? Shouldn't this just use "struct cleanup" throughout? Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com