Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: Reserved words in C Message-ID: <5476@brl-smoke.ARPA> Date: Mon, 5-Jan-87 13:39:59 EST Article-I.D.: brl-smok.5476 Posted: Mon Jan 5 13:39:59 1987 Date-Received: Mon, 5-Jan-87 21:59:40 EST References: <1524@hoptoad.uucp> <1016@zeus.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB)) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 31 In article <1016@zeus.UUCP> dant@tekla.tek.com (Dan Tilque) writes: >When I first learned C, there were about 80 or so words I needed to >learn (reserved words, preprocessor commands, frequently used routine >names and some miscellaneous). I didn't have to learn the library >routine names or #defines in headers I never used. In a hosted environment, one's code is normally linked against a "standard C library" that contains entry points for routines such as fflush() etc. Because some library routines might invoke others (unbeknownst to the user), it has always been unwise for the user to provide his own externally-visible functions with the same names as any library extern, whether or not he thought it wasn't being used. X3J11 hasn't done anything new in this regard except to standardize a subset of the C library and to introduce a handful of new externs/macros. Please note that a conforming implementation is not permitted to have any extensions that could alter the behavior of a strictly conforming program; one implication of this is that non-X3J11 entry points starting with anything other than _ must NOT be present in the implementation's standard C library. This isn't as bad as it sounds, since for example the UNIX "cc" could require use of a flag to obtain a conforming environment (the best way to implement this might be to provide the pure X3J11 environment as a separate-but-equal library that invokes system calls using names such as _read() instead of read()). I'm not sure that's what X3J11 intended, but it's what I deduce from section 1.6 of the Draft Proposed Standard; however, one wonders why "additional library functions" are mentioned if they would be so hard to provide (basically, there would have to be a header file that redefined the externs as _-names).