Re: Core dump constructing a C++ string with NULL

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

 



On Thu, Jan 13, 2011 at 14:59, Ian Lance Taylor <iant@xxxxxxxxxx> wrote:
> Tom Browder <tom.browder@xxxxxxxxx> writes:
>
>> It would be nice if this would construct an empty string:
>>
>>   #include <string>
>>   std::string s(0);
>>
> As to whether libstdc++ should check for NULL, that is a perennial
> question: should we slow down the library a tiny bit for everybody in
> order to do better handling of an undefined case for those who find it
> more convenient?  There is no clearly correct answer.

How about a compiler option then, something like
"--allow-c++-null-string-constructor"...

Regards,

-Tom



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux