This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [continuation args 2/2] Make continuation args not leak
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: pedro at codesourcery dot com (Pedro Alves)
- Cc: drow at false dot org (Daniel Jacobowitz), gdb-patches at sourceware dot org
- Date: Sat, 12 Jul 2008 22:23:41 +0200 (CEST)
- Subject: Re: [continuation args 2/2] Make continuation args not leak
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