sc 6.1 - Allow ANSI pre-processor and read-only strings

John Woods john at frog.UUCP
Tue Apr 4 07:04:00 AEST 1989


In article <16445 at yoyodyne.mips.COM>, koblas at mips.COM (David Koblas) writes:
> In article <137 at titania.warwick.ac.uk> cudcv at 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 at frog.UUCP, ...!mit-eddie!jfw, jfw at eddie.mit.edu

			Remainder Khomeini!



More information about the Comp.sources.bugs mailing list