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 libstdc++/26458] Passing a NULL char* into output stream now breaks the output stream


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

Ian Lance Taylor <ian at airs dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ian at airs dot com

--- Comment #11 from Ian Lance Taylor <ian at airs dot com> 2011-03-13 06:04:06 UTC ---
I don't think the C++ standard requires this behaviour at all when using
operator<< with NULL.  The standard says that a pointer value is required to be
non-NULL.  That means that passing a pointer value of NULL is undefined
behaviour.  The standard imposes no requirement at all.

I think it would be much better if libstdc++ printed "(null)" here as the glibc
printf function does.  If that it not acceptable for some odd reason, then I
think we should throw an exception.  I think the current behaviour is worse
than useless in practice.


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