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: draft ANSI standard: major, quiet, unnoticed change Message-ID: <1379@hoptoad.uucp> Date: Tue, 2-Dec-86 00:15:35 EST Article-I.D.: hoptoad.1379 Posted: Tue Dec 2 00:15:35 1986 Date-Received: Tue, 2-Dec-86 03:30:22 EST Organization: Nebula Consultants in San Francisco Lines: 43 [This is posted to comp.lang.c because mod.std.c seems to be dead. Love those mod groups!] The standard's rationale tries to mark as "QUIET CHANGES" any change in the definition of C that would make a previously working program quietly take on some new meaning, without any warning or error report. Unfortunately, they missed a few. The new standard disallows an implementation's pre-#defining any words that don't begin with _ (section 3.8.8, "No macro names without a leading underscore shall be predefined."). This breaks all the code that uses #ifdef vax or #ifdef unix or #ifdef sun or all the other little predefines we've come to know and love. Of course, the committee can say "well, they can just change their Makefile every time they port that code" but it is definitely a change that breaks large bodies of existing code. Besides, do you want to add -Dunix -Dsun -Dmc68000 to every compile you ever run? One possible workaround is a set of configuration #define's which are only visible to #if and #ifdef, not to program code. Yes, this is a kludge, but I think it is less of a kludge than breaking all that code or letting anybody predefine any name (the Main Computer Company will have a rough time predefining #ifdef main...). #pdefine sun would cause #if sun or #if defined(sun) or #ifdef sun to be true, but would not replace occurrances of "sun" in program text. Presumably an implementation could more freely have a set of these "pdefines" predefined, since they would not cause trouble to innocent program code, just to innocent preprocessor lines. -- John Gilmore {sun,ptsfa,lll-crg,ihnp4}!hoptoad!gnu jgilmore@lll-crg.arpa "I can't think of a better way for the War Dept to spend money than to subsidize the education of teenage system hackers by creating the Arpanet."