Re: Signal memory leak.




On 11 Jan 2000, Anders Melchiorsen wrote:

> David Benson <daveb@idealab.com> wrote:
> 
> > In C (and in C++ w/o MI), you can just pass and cast pointers w/o
> > their values being changed, even if the cast is fully invalid.  For
> > example:
> 
> Isn't this what is causing programs to break with the (valid)
> -fstrict-aliasing optimization of gcc 2.95+ ?

No, I believe it breaks abusive references
to stuff in unions ("type punning"),
not the normal structure-packing/casting rules.


I was just justifying the correctness
of code currently using connect_object w/o the slot_object being
a gtkobject, rather than advocating this as good programming style.
It is correct b/c:

	((A*) (GtkObject*) (A*) a_ptr) == (A*) a_ptr

regardless of the setting of strict-alias.


- Dave



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]