Possible C Compiler Bug?

Fred Fish fnf at unisoft.UUCP
Tue Jun 10 07:00:08 AEST 1986


In article <6200004 at wvlpdp> john at wvlpdp writes:
>This compiles:
	[deleted]
>here:
>	;
>}
>
>This will not:
	[deleted]
>here:
>}
>	Is this a compiler bug?

No, though some broken compilers may accept it.  From K&R page 204:

	Any *statement* may be preceded by label prefixes..

	The null statement has the form

		;

	A null statement is useful to carry a label just before the
	} of a compound statement...

Bottom line is that you must "attach" the label to a statement, even if
only the null statement.

-Fred

===========================================================================
Fred Fish    UniSoft Systems Inc, 739 Allston Way, Berkeley, CA  94710  USA
{ucbvax,lll-lcc}!unisoft!fnf	(415) 644 1230 		TWX 11 910 366-2145
===========================================================================



More information about the Comp.unix mailing list