Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-crg!hoptoad!gnu From: gnu@hoptoad.uucp (John Gilmore) Newsgroups: comp.lang.c Subject: Re: ANSI C -- site identification Message-ID: <1524@hoptoad.uucp> Date: Fri, 19-Dec-86 05:04:24 EST Article-I.D.: hoptoad.1524 Posted: Fri Dec 19 05:04:24 1986 Date-Received: Fri, 19-Dec-86 22:57:52 EST References: <110@decvax.UUCP> <5459@brl-smoke.ARPA> <116@decvax.UUCP> <14114@amdcad.UUCP> Organization: Nebula Consultants in San Francisco Lines: 56 Martin Minow proposed a way for a program to figure out what machine it is being compiled for by using __XXX__ names. Rob Warnock proposed that these names take values assigned by the Internet folks. Both parties missed the boat. The problem is not that we have no way to tell what machine is being compiled for. The problem is that we have a few million tons of code that does so using #ifdef (and, occasionally, #if), and ANSI C disallows this. People have suggested that predefining e.g. sun as sun would fix this. This fixes it for #ifdef and for use in code, but does not fix it for #if. If I say #define sun sun #if sun what is the result? Maybe I am slo tonight, but the result is not obvious to me... I think that requiring such configuration #define's to define an identifier to itself is better than nothing. Does anyone know of a system that does that now? If not, I can't say that we understand the consequences of such a change. John Rogers (fortune!foros1!jr) compiled a list of predefined CPP symbols in 1984 and claimed to be maintaining the list. I won't tell you what they all mean, but here is the 1984 list: AOSVS, DATAGENERAL, DGUX, I8086, ON_SEL, PDP11, PWB, RES, RT, TM_DPS6, TM_L66, TS, TS_GCOS, TS_MOD400, V7, VIII, VV, __DATE__, __FILE__, __LINE__, __PAGE__, aegis, aosvs, apollo, cpm, datageneral, decus, dgux, ebcdic, gcos, hp9000s200, hp9000s500, ibm, ibm370, interdata, kl10, lint, m68000, m68k, mbb, mc68000, mert, mts, nomacarg, ns32000, orion, os, pdp11, pe3200, pyr, rsx, sel, selport, sun, tahoe, tops20, tss, u370, u3b, u3b2, u3b5, univac, unix, vax, vax11c, vms, z8000. He also proposed adding: bds, ccpm86, cpm68k, cpm80, cpm86, gnu, i80186, i80286, i8080, i8086, mc68008, mc68010, mc68020, mpm, msdos, pcdos, power5, xinu, z80, z800. In a slightly related area, I second Martin Minow's request for a list of all the predefined words ("keywords" and library routines and #define's) in ANSI C. I suspect that if people saw all the new words in one place, they would chop back the list, or move those hundreds of words into the "prefix _" category. Since the standards folks seem disinclined, anybody feel like reading the whole text and compiling the list? (gee, sounds like another job for machine readable text...) -- John Gilmore {sun,ptsfa,lll-crg,ihnp4}!hoptoad!gnu jgilmore@lll-crg.arpa Call +1 800 854 7179 or +1 714 540 9870 and order X3.159-198x (ANSI C) for $65. Then spend two weeks reading it and weeping. THEN send in formal comments!