Path: utzoo!utgpu!water!watmath!clyde!rutgers!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: (So-Called) ANSI C Message-ID: <6970@brl-smoke.ARPA> Date: 7 Jan 88 02:45:10 GMT References: <4668@pyr.gatech.EDU> <495@xyzzy.UUCP> <9930@mimsy.UUCP> <6925@brl-smoke.ARPA> <4725@pyr.gatech.EDU> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 452 In article <4725@pyr.gatech.EDU> roy@pyr.gatech.EDU (Roy Mongiovi) writes: >I still think that one develops a standard by finding a common SUBSET to the >existing dialects of a language, not by throwing in everything up to and >including the kitchen sink that someone somewhere thinks would be nice to >have. That's not a standard, it's a successor language. First, try sometime to define the universal common subset of existing C implementations, and see what it leaves you. I'm not sure it even can be done, but there sure wouldn't be enough left to be worth putting into a standard. One nice thing about ANSI C is that it is a rather rich development environment, including almost all the C library routines that I regularly need (but can't always count on finding). X3J11 most assuredly has not thrown in everything that someone somewhere thinks would be nice to have. To the contrary, they have resisted the temptation to an astonishing degree. If you think otherwise, you are either guessing incorrectly or have been misinformed. The introduction to the official response [document] to the first public review describes the reasoning behind X3J11's limited changes to the base language and library (K&R Appendix A and /usr/group 1984 Standard). I am appending the "troff -mm" source for the response document header, so you can see how resistant to "everything including the kitchen sink" the committee really has been. >I consider the entire thing to be misguided. If you don't feel the need for a C standard, fine. There are a lot of people who do. ============== First portion of response document follows: ============== '\" Run the following through troff -mm; if you don't have UNIX DWB, '\" you'll just have to suffer through the embedded formatting specs: '\" .ds cW (CW\" (CW if you have it, B otherwise (no space before this comment!) .nr Cl 2 .nr Ej 1 .nr Hb 4 .nr Hc 2 .ds HF 3 2 2 2 2 .ds HP +2 +2 .nr Au 0 .PH "''''" .OH "'Response to First Public Review'X3J11/87-206'Page \\\\nP'" .EH "'Page \\\\nP'X3J11/87-206'Response to First Public Review'" '\".PF "''\*(DT''" .PF "''November 2, 1987''" .TL X3J11 Responses to Issues Raised During First Public Review .AF "Document Number X3J11/87-206" .AU "" .MT 4 .AS This document contains the official X3J11 responses for all issues raised in formal comments received during the first public review of the Draft Proposed American National Standard for Information Systems \(em Programming Language C, X3.159-198\fIx\fP. Although these responses have been reviewed for accuracy and consistency, they do not constitute part of the proposed Standard. Please refer to the most recent drafts of the Standard and Rationale documents to accurately ascertain their current contents. .P The comments received were helpful in many ways, including identifying errors in the draft Standard and Rationale, pointing out the need to clarify or reword certain sections, and leading to Committee discussions resulting in either improvements to the draft Standard and Rationale or reaffirmations of previous decisions. The X3J11 Committee appreciates the comments received, including those that did not lead to changes in the drafts. .P There were many reasons for not adopting some of the suggestions. Specific individual reasons are provided in this document, but the following general remarks may be helpful in understanding why not all good ideas could be adopted. As indicated in the Rationale, the Committee had to balance many conflicting requirements when determining what should and should not be specified in the Standard. Primary emphasis was placed on correcting technical errors and removing unacceptable restrictions imposed by the specifications. '\" Following adapted from wording supplied by Plum: Although many suggestions for new inventions were interesting, X3J11 was in general not in a position to make any substantial change to the language at this point, unless it could be shown to address a severe deficiency. .P \" Start text from 86-206 The Committee has received numerous suggestions for enhancements, additions, and ``inventions''. In responding to such suggestions, we have been mindful of our obligation to standardize existing practice, rather than creating a new language. Many of these inventive suggestions appear to have real technical value, and it might be appropriate for implementors to experiment with them as locally-provided extensions. .P One of the valuable properties of C is that it is a ``small'' language. When one says that ``C is not Ada'', or that ``C is not PL/I'', the comparison of ``size'' is a major factor. In many cases, an advocate of one single suggestion might justifiably say that adding ``just this one feature'' would add only marginally to the ``size'' of the C language. The problem before the Committee was that a succession of such additions would eventually make C a much ``larger'' language than was desired. .P These judgements and tradeoffs might be more clearly appreciated by considering a selected list of inventive suggestions which were, in the end, rejected for inclusion in the C Standard. The Committee thanks the authors of the following items, and hopes they understand the difficulty of the tradeoffs involved in these choices. .P Herewith, a list of inventive suggestions not adopted: .VL "\w'\(sc4.12\ \ 'u" .LI \(sc2.1 .BL .LI Replace function \f\*(cWmain\fP with \f\*(cWmain-program\fP keyword. .LI Add function that returns pointer to command line. .LE .LI \(sc2.2 .BL .LI Add new escapes for \s-2DEL\s0, \s-2ESC\s0, \s-2LF\s0. .LI Add \f\*(cW#define\fPs to specify bit-field ordering. .LI Add header with object size, alignment, \fIetc.\fP .LE .LI \(sc3.0 .BL .LI Add parallel-processing capabilities. .LI Add method of specifying desired optimizations. .LE .LI \(sc3.1 .BL .LI Allow nested functions. .LI Add \f\*(cWprivate\fP keyword. .LI Provide semantics for \f\*(cWentry\fP. .LI Allow trailing \f\*(cW$\fP and \f\*(cW%\fP in variable names. .LI Provide syntax for arbitrary names. .LI Add \f\*(cWcomplex\fP data type. .LI Add \f\*(cWshort double\fP data type. .LI Provide method of specifying sizes of types. .LI Add typing by example. .LI Add additional types. .LI Provide constants for \f\*(cWstruct\fPs and \f\*(cWunion\fPs. .LI Add binary constants. .LI Provide nested comments. .LE .LI \(sc3.2 .BL .LI Provide \f\*(cWboolean\fP type. .LE .LI \(sc3.3 .BL .LI Allow local variables scoped to an expression. .LI Provide operator overloading. .LI Add expression enhancements: \f\*(cW(n == (\'A\' \(bv\|\(bv \'B\'))\fP. .LI Extend operators to types non-native to C. .LI Use \f\*(cW\s+2.\s0\fP operator in place of \f\*(cW\->\fP. .LI Add absolute offset operator. .LI Add \f\*(cWalignof\fP operator. .LI Allow ``address-of'' with constant. .LI Add Pascal-like indirection operator. .LI Add array dimension operator. .LI Add \fIcast-expression\fP \|\::\(eq\| \f\*(cW(\fP\fItype-name\fP\f\*(cW)\fP \fIcompound-statement\fP. .LI Add binary cast operator. .LI Allow floating-point operands to \f\*(cW%\fP. .LI Allow \f\*(cW=>\fP as well as \f\*(cW>=\fP. .LI Get rid of \f\*(cW=\fP \fIvs.\&\fP \f\*(cW==\fP confusion. .LI Add \f\*(cW?=\fP synonym for \f\*(cW==\fP. .LI Allow Pascal assignment operator as well as \f\*(cW=\fP. .LI Add new assignment operator which returns previous value. .LI Allow assignment of unlike structure types. .LI Allow \f\*(cW<=\fP like \f\*(cW+=\fP. .LI Provide different semantics for comma operator. .LE .LI \(sc3.4 .BL .LI Provide aggregate constants. .LE .LI \(sc3.5 .BL .LI Provide simpler form of declarations. .LI Allocate storage at specified addresses. .LI Add \f\*(cWpublic\fP and \f\*(cWlocal\fP storage classes. .LI Add distributed initialization. .LI Allow \f\*(cW:0\fP to pad at beginning of word. .LI Allow unnamed declarators for \f\*(cWstruct\fP padding. .LI Add bit-field extensions. .LI Add automatic \f\*(cWtypedef\fP for \f\*(cWstruct\fP types. .LI Provide more alignment control, \fIe.g.\fP \f\*(cWabut\fP. .LI Allow sizes for \f\*(cWenum\fPs. .LI Allow \f\*(cWenum\fP increment to be specified. .LI Adding optional arguments to function prototypes. .LI Provide multiple pointer types. .LI Add type-generic functions. .LI Provide semantics for \f\*(cWregister\fP functions. .LI Add \f\*(cWtypeof\fP operator. .LI Provide way to initialize an arbitrary member of \f\*(cWunion\fP. .LI Impute type of variable from type of initializer. .LI Allow omissions in initializer lists. .LE .LI \(sc3.6 .BL .LI Add Pascal-like \f\*(cWwith\fP construct. .LI Allow multiple entries to a function. .LI Add \f\*(cWcase\fP ranges. .LI Allow declarations anywhere in compound statement. .LI Add \f\*(cWasm\fP blocks. .LI Provide \f\*(cWcase\fP relationals (such as \f\*(cWcase \fP. .LE .LI \(sc4.7 .BL .LI Add ``reliable signals''. .LE .LI \(sc4.8 .BL .LI Variable arguments should be built-in. .LE .LI \(sc4.9 .BL .LI Provide ordered disk writes. .LI Add I/O to the language. .LI Add functions to handle directories. .LI Add file name wild-card functions. .LI Completely change \f\*(cWprintf\fP format syntax. .LI Compiler should check \f\*(cWprintf\fP formats. .LI Add check protection. .LI Nonzero precision on \f\*(cW%i\fP should cause decimal shift. .LI Provide semantics for precision in \f\*(cW%c\fP conversion. .LI Add format repetition. .LI Allow \f\*(cW%f\fP to use ``E'' notation for very large numbers. .LI Add way to skip to end of line. .LI Replace \f\*(cWvfprintf\fP with \f\*(cW%v\fP in \f\*(cWfprintf\fP. .LI Add \fIcurses\fP-like functions. .LI Add special console I/O functions. .LI Make \f\*(cWfgets\fP return pointer to end of buffer, not beginning. .LI Add ``locate mode'' I/O functions. .LI Add special type for \f\*(cWfseek\fP pointers. .LE .LI \(sc4.10 .BL .LI Add new functions: \f\*(cWfrand\fP, \f\*(cWlrand\fP, \f\*(cWsfrand\fP, and \f\*(cWslrand\fP. .LI Add \f\*(cWmalloc\fP-like function with user-controlled alignment. .LI Add \f\*(cWgetflags\fP function, to process command-line arguments to \f\*(cWmain\fP. .LI Provide an analog to the BCPL \s-2MULDIV\s0 function, which returns the quotient and remainder of \fIA\|*\|B\|/\|C\fP. .LE .LI \(sc4.11 .BL .LI Add \f\*(cWstrmove\fP function, which can handle overlapping strings. .LI Add move string up/down routines, to handle overlapping moves efficiently. .LI Add pattern-matching functions. .LE .LI \(sc4.12 .BL .LI Add new function: \f\*(cWldifftime\fP. .LE .LE '\" End text from 86-206 .P Another category of suggestions that were not adopted include requests for specifications that would conflict with existing practice on many systems, or with the constraints imposed by some important environments. In such cases, the Committee preferred to keep the Standard as widely useful as possible, to forestall the development of system-specific deviations from the Standard. .P The X3J11 Technical Committee believes that all issues raised by the correspondents have been adequately addressed, and will continue to assume that this is the case unless a correspondent responds to the contrary to the X3 Secretariat within fifteen working days. In order to ensure that the X3J11 Committee receives responses to the contrary in time to consider them at the December meeting, international correspondents are urged to send them to Tom Plum .I via FAX,\"[NUMBER DELETED], in addition to sending official responses to X3. There will be a second formal public review period during which additional comments on the revised draft proposed Standard may be registered. However, the Committee hopes that further modifications to the draft Standard can be limited to non-substantive editorial changes, so that the final, official Standard can be expeditiously published. .AE