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]

Re: Segmentation fault (core dumped) in little program


> #include <string>
> 
> main()
> {
>   string s(0);
> }
> 
> Any idea?

Thanks for your bug report. This is not a bug; your code calls

basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> >::basic_string(char const *)

which expects a non-null character pointer. It is ok if it crashes if
you pass a null pointer.

Regards,
Martin


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