This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]