A Saturday 12 July 2008 21:23:41, Ulrich Weigand wrote: > 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 ... > > > + 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. > Sorry for that. Missed building at > -O0 to catch these things. I thought that since the type is not defined, this would not be a problem, as you can't dereference through cmd_continuation. > Why do we still have a "struct continuation" (as nowhere-defined type)? > Shouldn't this just use "struct cleanup" throughout? Being a cleanup is an implementation detail, I didn't want to make that fact public. This fixes the issue for me by making the inheritance explicit. Tested on x86_64-unknown-linux-gnu async mode. OK? -- Pedro Alves