Since label definition and label reference are syntactically distinctive contexts, labels are established as a separate name space.
The Committee considered proposals
for forbidding a goto
into a block from outside,
since such a restriction would make possible much easier flow
optimization and would avoid the whole issue of initializing
auto
storage
(see §3.1.2.4).
The Committee rejected such a ban out of fear of invalidating working code
(however undisciplined)
and out of concern for those
producing machine-generated C.
The void
cast is not needed in an expression statement,
since any value is always discarded.
Some checking compilers prefer this reassurance, however, for functions
that return objects of types other than void
.
if
statementSee §3.6.2.
switch
statement
The controlling expression of a switch
statement may now have any integral type,
even unsigned long
.
Floating types were rejected for switch statements since exact
equality in floating point is not portable.
case
labels are first converted to the type of the controlling expression
of the switch, then checked for equality with other labels;
no two may match after conversion.
Case ranges
(of the form lo
..
hi
)
were seriously considered,
but ultimately not adopted in the Standard on the grounds that
it added no new capability, just a problematic coding convenience.
The construct seems to promise more than it could be mandated to deliver:
0
..
65535
.
'A'..'Z'
would specify all the integers between
the character code for A
and that for Z
. In some common
character sets this range would include non-alphabetic characters,
and in others it might not include all the alphabetic characters
(especially in non-English character sets).
long
expressions and constants in switch statements are
no longer truncated to int
.
while
statement
do
statement
for
statement
goto
statementSee §3.6.2.
continue
statement
The Committee rejected proposed enhancements to
continue
and break
which would allow specification of an iteration statement
other than the immediately enclosing one,
on grounds of insufficient prior art.
break
statementSee §3.6.6.2.
return
statement