Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!pyramid!prls!philabs!linus!raybed2!rayssd!mirror!frog!john From: john@frog.UUCP (John Woods) Newsgroups: comp.sources.bugs Subject: Re: sc 6.1 - Allow ANSI pre-processor and read-only strings Message-ID: <1196@frog.UUCP> Date: 3 Apr 89 21:04:00 GMT References: <137@titania.warwick.ac.uk> <16445@yoyodyne.mips.COM> Organization: Misanthropes-R-Us Lines: 27 In article <16445@yoyodyne.mips.COM>, koblas@mips.COM (David Koblas) writes: > In article <137@titania.warwick.ac.uk> cudcv@warwick.ac.uk (Rob McMahon) writes: > >! #define ctl(x) ('x'&037) > >--- 65,71 ---- > >! #define ctl(x) ((x)&037) > > Instead of doing this change there is a much simpler solution, which > of course allows you to not make such a huge change to existing code. > > #ifdef __STDC___ > # define ctl(x) (#x[0]&037) > #else > # define ctl(x) ('x'&037) > #endif > However, this solution does not handle the case of non-ANSI compilers which do not have the undocumented Reiser CPP features. The first solution is correct for Classic C as documented in "The Old Testament" (K&R I), and for all existing (correct) C compilers, Reiserish or not. -- John Woods, Charles River Data Systems, Framingham MA, (508) 626-1101 ...!decvax!frog!john, john@frog.UUCP, ...!mit-eddie!jfw, jfw@eddie.mit.edu Remainder Khomeini!