newlib: fputs aborts on ARM
Shaun Jackman
sjackman@gmail.com
Thu Nov 17 00:30:00 GMT 2005
2. Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end.
-- The Ten Commandments for C Programmers
http://www.lysator.liu.se/c/ten-commandments.html
Passing a NULL pointer to a C library function is no different than
dereferncing that same NULL pointer yourself. C library functions do
not check their arguments for a NULL pointer, just as the C language
does not check that an array index is within the bounds of the array.
This work is left up to the programmer so that it is her decision when
and where to do this work.
Consider a putc in an inner loop. The programmer would likely want to
check if the FILE* is NULL only once outside of the loop. If putc
checked itself, this would be done over and over inside the loop
unnecessarily.
This case is just one of those burdens the C programmer has to bear.
Cheers,
Shaun
2005/11/16, Tom Walsh <tom@openhardware.net>:
> Oh, I'm not saying that newlib is not compliant, what my issue is
...
More information about the Newlib
mailing list