This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: Coredump
- To: "Gcchelp" <gcc-help at gcc dot gnu dot org>
- Subject: RE: Coredump
- From: "Puneet Singhal" <puneet at opussoft dot com>
- Date: Thu, 14 Dec 2000 10:30:04 -0800
The same code works fine on NCR UNIX
When we port the same code to Solaris Sparc it gives a core dump why??
-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org]On
Behalf Of Alexandre Oliva
Sent: Wednesday, December 13, 2000 12:40 PM
To: Puneet Singhal
Cc: Gcchelp
Subject: Re: Coredump
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