[user] segfault w/ error 4
U.Mutlu
for-gmane@mutluit.com
Tue Sep 11 08:22:00 GMT 2012
Daniel Krügler wrote, On 09/11/2012 09:07 AM:
> 2012/9/11 U.Mutlu <for-gmane@mutluit.com>:
>> U.Mutlu wrote, On 09/11/2012 07:52 AM:
>>>
>> There was in a function a string comparisions whereby a const std::string
>> was compared against a const ptr to char ("if (s == psz) ...").
>> Not sure if that could be the reason (IMHO yes), as it indeed looked ugly &
>> dangerous
>
> There should be nothing wrong with this, *unless* the pointer to char
> was a null
> pointer. basic_string has overloaded operator== with const char* as a
> single argument as
> well.
>
>> I now have replaced the char ptr by an ordinary std::string.
>> Will wait & observe what happens... :-)
>
> I would expect no difference, if the std::string is initialized with
> the same char pointer.
Right you are, the crashes continue... :-(
More information about the Libstdc++
mailing list