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++/19476] Missed null checking elimination with new



------- Comment #6 from pinskia at gcc dot gnu dot org  2005-11-13 02:10 -------
(In reply to comment #5)
> Is this safe?  People can define their own operator new's, some of which may
> return null...

Yes because the normal operator new guarante not to return NULL by the C++
standard.  And if it returns a NULL that is undefined behavior, it should be
throwing an exception when memory could not be allocated (there is a nonthrow
version which can and will return NULL).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19476


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