my two cents
Chris Torek
chris at mimsy.UUCP
Mon Aug 8 14:15:39 AEST 1988
In article <5812 at batcomputer.tn.cornell.edu>
davidra at batcomputer.tn.cornell.edu (David A. Rabson) writes:
>... second edition of K&R ... "[string constants] are no longer
>modifiable, and so may be placed in read-only memory."
>This will cause mktemp() and many, many other things to break.
On the contrary, in practise it causes very little to break. Mktemp()
is in fact the only place I have seen code crash. Callers will have
to write
static char foo[] = "/tmp/abcXXXXXX";
name = mktemp(foo);
rather than simply
name = mktemp("/tmp/abcXXXXXX");
This is inconvenient, but not, I think, too drastic.
--
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain: chris at mimsy.umd.edu Path: uunet!mimsy!chris
More information about the Comp.std.c
mailing list