A tuff question about strings

Mike Laman laman at sdcsvax.UUCP
Sun Aug 14 04:12:26 AEST 1983

I don't think this got off this system, so I am resubmitting it.

There is a line in the System III source of "ed", that is like:

p = mktemp("/tmp/edXXXXXX");

Now as you may know "mktemp()" writes on the given argument.  I came
across a compiler that mapped strings into the linkage section.
Obviously, when "mktemp()" tried to write on the string, the program
died since the linkage section was write protected.  My question is

What does "The C Programming Language" say about this problem?  Was
the compiler incorrect according to Kerningham and Ritchie?

I am NOT asking if people SHOULD do it or not.  That will be as
interesting a discussion as where people put their curly braces.
I just want to find what is correct.  You might as well submit it to the net;
this could be interesting.  I can't find the answer in the book.

				Mike Laman
				UUCP: {ucbvax,philabs,sdccsu3}!sdcsvax!laman
				ARPA: mike at NPRDC

More information about the Comp.lang.c mailing list