This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Segmentation fault (core dumped) in little program
- To: gustavo at geneura dot ugr dot es
- Subject: Re: Segmentation fault (core dumped) in little program
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Tue, 11 Jan 2000 02:02:25 +0100
- CC: egcs-bugs at egcs dot cygnus dot com
- References: <387A1697.14370D94@geneura.ugr.es>
> #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