promised list of C enhancements received by X3J11

Doug Gwyn gwyn at smoke.BRL.MIL
Wed Jul 26 04:39:18 AEST 1989


'\"	Abridged from cover text of most recent X3J11 response document
'\"	"troff -mm" input format
'\"
.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
.SA 0
.PH "''''"
.PF "''[DATE]''"
.OH "'[DOCUMENT TITLE]'[X3J11 DOC.\& NO.]'Page \\\\nP'"
.EH "'Page \\\\nP'[X3J11 DOC.\& NO.]'[DOCUMENT TITLE]'"
.TL
[FULL X3J11 DOCUMENT TITLE]
.AF "Document Number [X3J11 DOC.\& NO.]"
.AU ""
.MT 4
.AS
[DESCRIPTION OF SPECIFIC DOCUMENT]
.P
There were many reasons for not adopting some of the suggestions.
Specific individual reasons are provided in the official response documents,
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.
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
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 \fI\&size\fP 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 partial list of inventive suggestions not adopted:
.VL "\w'\(sc\&4.12\ \ 'u"
.ne 1i
.LI \(sc\&2.1
.BL
.LI
Replace the function \f\*(cW\&main\fP with a \f\*(cW\&main-program\fP keyword.
.LI
Add a function that returns a pointer to command line.
.LE
.ne 1i
.LI \(sc\&2.2
.BL
.LI
Add new escapes for \s-2\&DEL\s0, \s-2\&ESC\s0, \s-2\&LF\s0.
.LI
Add \f\*(cW#define\fPs to specify bit-field ordering.
.LI
Add a header with object size, alignment, \fI\&etc.\fP
.LE
.ne 1i
.LI \(sc\&3
.BL
.LI
Add parallel-processing capabilities.
.LI
Add a method of specifying desired optimizations.
.LE
.ne 1i
.LI \(sc\&3.1
.BL
.LI
Allow nested functions.
.LI
Add a \f\*(cW\&private\fP keyword.
.LI
Provide semantics for \f\*(cW\&entry\fP.
.LI
Allow trailing \f\*(cW$\fP and \f\*(cW%\fP in variable names.
.LI
Provide a syntax for arbitrary names.
.LI
Add a \f\*(cW\&complex\fP data type.
.LI
Add a \f\*(cW\&short double\fP data type.
.LI
Provide a method of specifying sizes of types.
.LI
Add typing by example.
.LI
Add additional types.
.LI
Provide constants for \f\*(cW\&struct\fPs and \f\*(cW\&union\fPs.
.LI
Add binary constants.
.LI
Provide nested comments.
.LE
.ne 1i
.LI \(sc\&3.2
.BL
.LI
Provide a \f\*(cW\&boolean\fP type.
.LE
.ne 1i
.LI \(sc\&3.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 the \f\*(cW\s+2.\s0\fP operator in place of \f\*(cW\->\fP.
.LI
Add an absolute offset operator.
.LI
Add an \f\*(cW\&alignof\fP operator.
.LI
Allow ``address-of'' to be applied to constants.
.LI
Add a Pascal-like indirection operator.
.LI
Add an array dimension operator.
.LI
Add \fI\&cast-expression\fP \|\::\(eq\|
\f\*(cW(\fP\fI\&type-name\fP\f\*(cW)\fP \fI\&compound-statement\fP.
.LI
Add \fI\&primary-expression\fP \|\::\(eq\|
\f\*(cW(\fP \fI\&compound-statement\fP \f\*(cW)\fP.
.LI
Add a binary cast operator.
.LI
Allow floating-point operands to \f\*(cW%\fP.
.LI
Add a \f\*(cW^^\fP (logical exclusive-or) operator.
.LI
Add \fI\&logical-op\fP\f\*(cW=\fP operators.
.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 as a synonym for \f\*(cW==\fP.
.LI
Allow Pascal's assignment operator as well as \f\*(cW=\fP.
.LI
Add a new assignment operator which returns the pre-assignment value.
.LI
Allow assignment of unlike structure types.
.LI
Allow \f\*(cW<=\fP analogous to \f\*(cW+=\fP.
.LI
Provide different semantics for the comma operator.
.LE
.ne 1i
.LI \(sc\&3.4
.BL
.LI
Provide aggregate constants.
.LE
.ne 1i
.LI \(sc\&3.5
.BL
.LI
Provide a simpler form of declarations.
.LI
Allocate storage at specified addresses.
.LI
Add \f\*(cW\&public\fP and \f\*(cW\&local\fP storage classes.
.LI
Add distributed initialization.
.LI
Allow \f\*(cW:0\fP to pad at the beginning of a word.
.LI
Allow unnamed declarators for \f\*(cW\&struct\fP padding.
.LI
Add bit-field extensions.
.LI
Add automatic \f\*(cW\&typedef\fP for \f\*(cW\&struct\fP types.
.LI
Provide more alignment control, \fIe.g.\fP \f\*(cW\&abut\fP.
.LI
Allow sizes for \f\*(cW\&enum\fPs.
.LI
Allow the \f\*(cW\&enum\fP increment to be specified.
.LI
Add optional arguments to function prototypes.
.LI
Provide multiple pointer types.
.LI
Add type-generic functions.
.LI
Provide semantics for \f\*(cW\&register\fP functions.
.LI
Add a \f\*(cW\&typeof\fP operator.
.LI
Add \f\*(cW\&typedef\fP \fI\&identifier\fP \f\*(cW=\fP
\fI\&expression\fP\f\*(cW;\fP.
.LI
Add anonymous \f\*(cW\&struct\fP and \f\*(cW\&union\fP.
.LI
Add a keyword ``\f\*(cW\&hidden\fP'' as an alternative to anonymous structures.
.LI
Add an \f\*(cW\&extract\fP operator for extracting substructures.
.LI
Provide a way to initialize an arbitrary member of a \f\*(cW\&union\fP.
.LI
Impute the type of a variable from the type of its initializer.
.LI
Allow omissions in initializer lists.
.LI
Add a \f\*(cW\&writeonly\fP type qualifier.
.LI
Add a \f\*(cW\&noalias\fP type qualifier to aid optimization.
.LI
Add \f\*(cW\&nonconst\fP and \f\*(cW\&nonvolatile\fP type qualifiers.
.LE
.ne 1i
.LI \(sc\&3.6
.BL
.LI
Add a Pascal-like \f\*(cW\&with\fP construct.
.LI
Allow multiple entries to a function.
.LI
Add \f\*(cW\&case\fP ranges.
.LI
Allow declarations anywhere in a compound statement.
.LI
Add \f\*(cW\&asm\fP blocks.
.LI
Provide \f\*(cW\&case\fP relationals (such as \f\*(cW\&case <n:\fP).
.LI
Provide \f\*(cW\&case\fP continuation
(eliminate the ``mutually exclusive'' constraint).
.LI
Make \f\*(cW\&while (\|)\fP mean ``infinite loop''.
.LI
Allow \f\*(cW\&do\fP without \f\*(cW\&while\fP for infinite loops.
.LI
In a \f\*(cW\&switch\fP within a loop,
make \f\*(cW\&break;\ break;\fP quit both the \f\*(cW\&switch\fP and the loop.
.LE
.ne 1i
.LI \(sc\&3.7
.BL
.LI
Allow nested function definitions.
.LI
Allow soft (weak) entry points.
.LI
Support ``pure'' code, \fI\&e.g.\&\fP \f\*(cW\&const\fP function.
.LE
.ne 1i
.LI \(sc\&3.8
.BL
.LI
Add new directives:
\f\*(cW#note\fP, \f\*(cW#warning\fP, \f\*(cW#ask\fP,
\f\*(cW#echo\fP, \f\*(cW#halt\fP, \f\*(cW#redef\fP.
.LI
Add \f\*(cW#(\fP \fI\&constant-expr\fP \f\*(cW)\fP.
.LI
Make \f\*(cW#define\fP more like an ``editor substitute'' power.
.LI
Add \f\*(cW_\^_STDP_\^_\fP for indicating preprocessing conformance.
.LI
Add \f\*(cW_\^_FUNCTION_\^_\fP, expanding to the current function name.
.LI
Combine \f\*(cW_\^_DATE_\^_\fP and \f\*(cW_\^_TIME_\^_\fP
to return a \f\*(cW\&struct tm\fP.
.LE
.ne 1i
.LI \(sc\&4
.BL
.LI
Add byte ordering, alignment, and sizing functions and/or rules.
.LI
Add windowing functions.
.LI
Provide support for generic objects.
.LI
Provide a way to determine object alignment requirements.
.LI
Enlarge the standard library to include a variety of useful functions.
.LE
.ne 1i
.LI \(sc\&4.1
.BL
.LI
Require \f\*(cW\&NULL\fP to be built in.
.LI
Add \f\*(cW\&TRUE\fP, \f\*(cW\&FALSE\fP, and \f\*(cW\&EOS\fP macros.
.LE
.ne 1i
.LI \(sc\&4.3
.BL
.LI
Add \f\*(cW\&is_alpha\fP, \f\*(cW\&is_alnum\fP, and \f\*(cW\&isodigit\fP.
.LE
.ne 1i
.LI \(sc\&4.5
.BL
.LI
Add symbols for infinity and not-a-number to \f\*(cW<math.h>\fP.
.LE
.ne 1i
.LI \(sc\&4.7
.BL
.LI
Require ``reliable signals''.
.LI
Define \f\*(cW\&SIGERR\fP for algorithmic errors.
.LE
.ne 1i
.LI \(sc\&4.8
.BL
.LI
Require variable arguments to be accessed through built-in facilities.
.LE
.ne 1i
.LI \(sc\&4.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 the \f\*(cW\&printf\fP format syntax.
.LI
Require the compiler to check \f\*(cW\&printf\fP formats.
.LI
Add check protection.
.LI
Require nonzero precision on \f\*(cW%i\fP to cause a decimal shift.
.LI
Provide semantics for precision in \f\*(cW%c\fP conversions.
.LI
Add format repetition.
.LI
Allow \f\*(cW%f\fP to use ``\f\*(cW\&E\fP'' notation for very large numbers.
.LI
Add a way to skip to the end of a line.
.LI
Replace \f\*(cW\&vfprintf\fP with \f\*(cW%v\fP in \f\*(cW\&fprintf\fP.
.LI
Add \f\*(cW\&vfscanf\fP \fI\&etc.\fP
.LI
Add formatted I/O functions that invoke an application-supplied
character I/O function.
.LI
Require stream I/O functions to set \f\*(cW\&errno\fP upon error.
.LI
Add \fI\&curses\fP-like functions.
.LI
Add special console I/O functions.
.LI
Make \f\*(cW\&fgets\fP return a pointer to the end of the buffer,
not the beginning.
.LI
Add ``locate mode'' I/O functions.
.LI
Add a special type for \f\*(cW\&fseek\fP pointers.
.LE
.ne 1i
.LI \(sc\&4.10
.BL
.LI
Add new functions:
\f\*(cW\&frand\fP, \f\*(cW\&lrand\fP, \f\*(cW\&sfrand\fP,
and \f\*(cW\&slrand\fP.
.LI
Add a \f\*(cW\&malloc\fP-like function with user-controlled alignment.
.LI
Add a \f\*(cW\&getflags\fP function,
to process command-line arguments to \f\*(cW\&main\fP.
.LI
Provide an analog to the BCPL \s-2\&MULDIV\s0 function,
which returns the quotient and remainder of \fIA\|\(**\|B\|/\|C\fP.
.LI
\f\*(cW\&strtod\fP should convert \f\*(cW"e25"\fP.
.LI
Add \f\*(cW\&dtostr\fP \fI\&etc.\fP
.LI
Provide pointer/text interconversion functions.
.LE
.ne 1i
.LI \(sc\&4.11
.BL
.LI
Add a function like \f\*(cW\&strncpy\fP with null termination guaranteed.
.LI
Add a \f\*(cW\&strmove\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
.ne 1i
.LI \(sc\&4.12
.BL
.LI
Add a new function:
\f\*(cW\&ldifftime\fP.
.LE
.LE
.P
Another category of suggestions that were not adopted
includes 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.
.AE
[DETAILED RESPONSES]



More information about the Comp.std.c mailing list