This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: null parameters to functions

>From: Earnie Boyd <>

>Christopher Faylor wrote:
>> On Thu, Feb 21, 2002 at 09:13:56AM +1100, Robert Collins wrote:
>> >Remembering all the effort that went into sanitising various userland
>> >function parameters a few months ago... newlib suffers from similar
>> >flaws (I just noticed one with strcmp (0, foo);).
>> >
>> >Is this something worth fixing?
>> Agh.  How does linux handle this?  Doe sit return EADDR or something?

>IIRC, it's not an error in Linux land or most *nixes for that matter. 
>It OS dependent on how addressing a null pointer is handled.  Looking at
>the man page from HPUX 11 it says that null pointer values are treated
>as empty strings.

The standard compliant behavior is to dump core. However not all OS behave
correctly and thus e.g. Software developend on Linux will start dumping core
because the author did not have the possibility to verify his code for
correctness on Linux :-(

Jörg (home) Jörg Schilling D-13353 Berlin		(uni)  If you don't have iso-8859-1		(work) chars I am J"org Schilling

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