James Carlson wrote:
> Darren J Moffat writes:
>   
>> The behavior of HP-UX and AIX is unknown to the author of this case,
>> and since they are closed source there is no easy we to determine what
>> their implementation does.
>>     
>
> AIX prints an empty string, as though "" had been passed in.  Our
> HP-UX box has locked up, or I'd give you that one as well.  :-/
>
>   
If memory serves, I seem to remember at least one platform (can't recall 
which) where passing a NULL pointer as a string to printf actually 
caused printf to print the string "<NULL>".

I don't remember which platform that was, though, Scince it's not AIX or 
(from another post) HP-UX, then the only other ones I worked on were 
IRIX and Ultrix...oh and a little OSF/1.

  -Kyle

>> This isn't a scalable way to approach the problem and hurts the
>> reputation of Solaris and OpenSolaris releases.  It also hinders the
>>     
>
> The sad thing here is that it's really the bug-ridden application code
> that mishandles NULL pointers that's of poor quality, so it's not
> OpenSolaris's reputation that should be at stake.
>
> So, with this one under our belts, should we also fix up the str*(3C)
> family of functions so that they quietly ignore NULL pointers as well?
> An application that's incautious with NULL can't possibly just make
> that mistake with printf alone, can it?
>
> Is NULL the only bad pointer worth caring about?  What sorts of bad
> pointer checks need to be made so that malfunctioning applications can
> continue running without dropping core?  How deep does the rabbit hole
> go?
>
>   


Reply via email to