Path: utzoo!yunexus!geac!daveb From: daveb@geac.UUCP (David Collier-Brown) Newsgroups: comp.lang.c Subject: Re: readonly strings vs. sscanf Summary: History (aka "v6 didn't have "static") Keywords: static strings Message-ID: <2084@geac.UUCP> Date: 7 Jan 88 13:44:13 GMT Article-I.D.: geac.2084 Posted: Thu Jan 7 08:44:13 1988 References: <4668@pyr.gatech.EDU> <2046@haddock.ISC.COM> <400@uniq.UUCP> <633@mcdsun.UUCP> <10051@mimsy.UUCP> Reply-To: daveb@geac.UUCP (David Collier-Brown) Organization: Geac Lines: 32 >In article <633@mcdsun.UUCP> fnf@mcdsun.UUCP (Fred Fish) writes: >>I have a feeling [readonly strings are] going to break more code than >>just the obvious stuff, including something deep in the bowels of stdio. >>... In article <10051@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes: >This is easy to fix. The changes I made to 4.3BSD stdio to allow >functions as streams also included something that happens to fix >this as well as a nastier bug (one that might quietly corrupt a byte >somewhere) involving unbuffered streams and low free memory. The old read/write strings were required in order to simulate statics back before they were put in the compiler. In bar() { char *foo = "fred"; ... foo was auto, but "fred" was effectively static. This was then used in a few (hopefully VERY few) programs to simulate having a static flag variable: you stored data-to-be-kept to *foo or foo[n]. I strongly suspect that the programs which depended on that are rare, elderly and obsolete. Ie, they were fixed in v7. That they weren't fixed in BSD until 4.3 reflects rather badly on someone, and rather well on Chris for spotting and deleting them. --dave (put 'em in the code space! thats where they belong in D) c-b -- David Collier-Brown. {mnetor|yetti|utgpu}!geac!daveb Geac Computers International Inc., | Computer Science loses its 350 Steelcase Road,Markham, Ontario, | memory (if not its mind) CANADA, L3R 1B3 (416) 475-0525 x3279 | every 6 months.