This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Coredump
- To: "Puneet Singhal" <puneet at opussoft dot com>
- Subject: Re: Coredump
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 13 Dec 2000 18:40:13 -0200
- Cc: "Gcchelp" <gcc-help at gcc dot gnu dot org>
- Organization: GCC Team, Red Hat
- References: <NEBBJEIPELDNPPCBOLOPCENKCAAA.puneet@opussoft.com>
On Dec 13, 2000, "Puneet Singhal" <puneet@opussoft.com> wrote:
> char *p=NULL;
> printf("%s", p);
> I get a coredump at runtime.
What did you expect? You tell it to print a NUL-terminated string,
and don't give it a string at all.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me