default case

Tim W Smith ts at cup.portal.com
Sun Dec 31 20:46:22 AEST 1989


Is it too late to make suggestions for ANSI C?  I'd like to see
the following added to C:

	The keyword "case" can be followed by the keyword
	"default" to indicate the default case.  This is
	in addition to the current method of just saying
	"default".

The reason I want this is because it makes it possible for the
compiler to notice when you misspell "default".  I has a switch
statement and I used "defualt" for the default case, and the
compiler correctly took this as a label.  It took quite a while
to track this down.

Note that this would not break any existing code.

						Tim Smith



More information about the Comp.lang.c mailing list