Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: pedro@codesourcery.com (Pedro Alves)
Cc: drow@false.org (Daniel Jacobowitz), gdb-patches@sourceware.org
Subject: Re: [continuation args 2/2] Make continuation args not leak
Date: Sat, 12 Jul 2008 20:24:00 -0000	[thread overview]
Message-ID: <200807122023.m6CKNfDU019191@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <200807122027.59292.pedro@codesourcery.com> from "Pedro Alves" at Jul 12, 2008 08:27:59 PM

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


  reply	other threads:[~2008-07-12 20:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-11 20:39 Pedro Alves
2008-07-12 18:55 ` Daniel Jacobowitz
2008-07-12 19:28   ` Pedro Alves
2008-07-12 20:24     ` Ulrich Weigand [this message]
2008-07-12 22:53       ` Pedro Alves
2008-07-13  4:28         ` Daniel Jacobowitz
2008-07-13 11:30           ` Pedro Alves
2008-07-15 18:44             ` Ulrich Weigand

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=200807122023.m6CKNfDU019191@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.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