This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11376] [3.3/3.4 regression] mozilla-1.4 miscompiled
- From: "giovannibajo at libero dot it" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Jun 2003 13:20:22 -0000
- Subject: [Bug c++/11376] [3.3/3.4 regression] mozilla-1.4 miscompiled
- References: <20030630081619.11376.sirl@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11376
------- Additional Comments From giovannibajo at libero dot it 2003-06-30 13:20 -------
The bug cannot be reproduced on i686-pc-cygwin. Anyway, I have some comments on
the code:
- Are the specializations of nsCOMPtr<> and nsGetterAddRefs<> really necessary
to trigger the bug? They look to me just manual replacements of the template
argument. If the are needed, did you try removing the definition of the general
templates?
- Are all the member functions of the templates really used by the program?
- This:
nsDerivedSafe<T>*
get() const
{
return reinterpret_cast< nsDerivedSafe<T>* >(mRawPtr);
}
is not typesafe and generates undefined behaviour if you do anything with the
returned pointer BUT casting it back to its original type (nsISupports*).