This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug c++/11376] [3.3/3.4 regression] mozilla-1.4 miscompiled


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*).


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