This is the mail archive of the gcc-help@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: Coredump


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

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