What should be added to C

Carl Micarelli 6063366 at pucc.BITNET
Wed May 21 08:11:26 AEST 1986


In article <1462 at mmintl.UUCP>, Frank Adams (franka at mmintl.UUCP) suggests
adding the following to C:

>o Any sort of multi-level break statement.  There is no syntacticly clean
>way of adding this to C.

Good idea, but I don't think there's any syntactically clean way of
implementing a multi-level break statement in C -- at least no way that's
preferable to a goto.

>There are several things which are not part of the language definition, but
>which would be useful in compilers.  These consist mostly of flagging
>certain statements with (at least) warning messages.

Requiring compilers to flag constructions that look like bugs is a good idea,
but only if you establish a standard way of forcing the compiler to
(selectively) shut up.

>(Actually, I wouldn't be averse to a coding standard which forbade such
>things [as if (v = e) ... ], in favor of if (v = e, v) ...)

No!  = is an operator, v=e has a value, and its value should be usable
anywhere.  Making up special rules -- even for the noble purpose of protecting
programmers from carelessness or typos -- just complicates things.

Carl Micarelli -  BITNET: 6063366 at pucc
                  UUCP:   ...allegra!psuvax1!pucc.bitnet!6063366



More information about the Comp.lang.c mailing list