🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #5266

Re: my two cents

#5266
From: Chris Torek
Date: Mon, 08 Aug 1988 04:15
22 lines
1139 bytes
In article <5812@batcomputer.tn.cornell.edu>
davidra@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@mimsy.umd.edu	Path:	uunet!mimsy!chris
Technical Details
Message-ID: <12892@mimsy.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!oddjob!mimsy!chris
References: <5812@batcomputer.tn.cornell.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!oddjob!mimsy!chris
From: chris@mimsy.UUCP (Chris Torek)
Newsgroups: comp.std.c
Subject: Re: my two cents
Keywords: string constant
Message-ID: <12892@mimsy.UUCP>
Date: 8 Aug 88 04:15:39 GMT
References: <5812@batcomputer.tn.cornell.edu>
Distribution: comp
Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742
Lines: 22