RMS comments to X3J11

rbutterworth at watmath.UUCP rbutterworth at watmath.UUCP
Sat Jan 17 00:13:24 AEST 1987


In article <303 at haddock.UUCP>, karl at haddock.UUCP (Karl Heuer) writes:
> Someone else already suggested a variant that I think is more viable:
> 	#define	_machine_	"u3b2"
> could be tested by some comparison operator.  Either "==" or "strcmp(,)==0"
> could be used, but since the interpretation is not identical to that of C, I
> will suggest a new preprocessor operator "#==".

Even that extension isn't good enough.
What if I want to test for "vax" in some places and "vax/780" in others?
Using #ifdef is still the best solution and it doesn't require any changes
to cpp.  e.g.
#if defined(_TS_UNIX)
#   if defined(_TS_UNIX_BSD) && !defined(_TS_UNIX_BSD_4_3)
...

You can't do such things (assuming one really wants to do such things)
using a single _operating_system_ symbol.

The only "change" is that X3J11 should reserve some prefixes such as
"_TS_" and "_TM_" for local defintions of the target operating system
and target machine.



More information about the Comp.lang.c mailing list