shared memory

Karl Heuer karl at haddock.ima.isc.com
Tue Sep 25 13:47:33 AEST 1990


In article <1990Sep24.135530.405 at DRD.Com> mark at DRD.Com (Mark Lawrence) writes:
>[In response to a complaint about code using `strerror()']
>The following thanks to Chris Torek:
>const char     *strerror(int err) { ... }

The prototype is wrong: strerror() returns an unqualified `char *' according
to the ANS.  The characters are *not* constant: out-of-range error values are
stored in a buffer that gets overwritten by subsequent calls.  (Acceptable
behavior, but incompatible with the declaration.)

Karl W. Z. Heuer (karl at kelp.ima.isc.com or ima!kelp!karl), The Walking Lint



More information about the Comp.lang.c mailing list