Possible C Compiler Bug?

Henry Mensch henry at mit-trillian.MIT.EDU
Wed Jun 11 02:14:03 AEST 1986


In article <6200004 at wvlpdp> john at wvlpdp writes:
>
>This compiles:
>main()
>{
>	A lot of code here;
>	goto here;
>	More code here;
>here:
>	;
>}
>
>This will not:
>main()
>{
>	A lot of code here;
>	goto here;
>		
>
>here:
>}
>
>	Is this a compiler bug?

	This is *not* a compiler bug -- Kernighan & Rtichie states
that "Any statement may be preceded by label prefixes of the form 

	identifier:

which serve to declare the identifier as a label. . . ."  The example
that you show which does *not* compile does *not* have a statement
after the label, and the label is misplaced.  

	Your first example has a null statement after the label. This
works fine, since there is indeed a statement after the label.

-- 
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Henry Mensch     |    Technical Writer     | MIT/Project Athena
henry at athena.mit.edu              ..!mit-eddie!mit-athena!henry



More information about the Comp.unix mailing list