[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gcc and mint-libs PL46



What you wrote:
> 
> > Bug in the mint libs (PL46)?
> > 
> > Try:
> > 
> > fopen( NULL, "r" );
> > 
> > Results in a Bus Error.
> 
> Dereferencing a NULL pointer is not portable, so it's not a library bug.
> You'll get the same result on many UNIX systems.

fopen should check for NULL and return NULL.  And applications should
also check their return values for validity...

fopen( NULL, "r" ) returns NULL under QNX; assuming WATCOM implements the
ANSI spec properly (a pretty safe assumption), that's how it should act.

-- 
----------========================================================----------
Chris Herborth, R&D Technical Writer       Arcane  Dragon     chrish@qnx.com
QNX Software Systems, Ltd.                  -==(UDIC)==-         |||  JAGUAR
http://quest.jpl.nasa.gov/Info-ZIP/people/cjh/chris.html        / | \ 64-bit