From owner-cvs-all Sat Apr 27 11:33: 7 2002 Delivered-To: cvs-all@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 70E3C37B41B; Sat, 27 Apr 2002 11:32:55 -0700 (PDT) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id EAA08649; Sun, 28 Apr 2002 04:32:50 +1000 Date: Sun, 28 Apr 2002 04:34:03 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Marcel Moolenaar Cc: cvs-committers@FreeBSD.org, Subject: Re: cvs commit: src/sys/kern subr_witness.c In-Reply-To: <20020427181656.GA315@dhcp01.pn.xcllnt.net> Message-ID: <20020428042233.E1235-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, 27 Apr 2002, Marcel Moolenaar wrote: > On Sun, Apr 28, 2002 at 02:51:38AM +1000, Bruce Evans wrote: > > On Fri, 26 Apr 2002, Marcel Moolenaar wrote: > > > > > marcel 2002/04/26 19:58:18 PDT > > > > > > Modified files: > > > sys/kern subr_witness.c > > > Log: > > > Insert a semi-colon between label 'skip:' and the closing brace > > > of the FOREACH loop to silence GCC 3. > > > > Why not do this to fix the syntax error? > > What syntax error? The one complained about by gcc 3. %%% Script started on Sun Apr 28 04:21:03 2002 ttyp0:bde@besplex:/tmp> cat z.c void foo(void) { int i; for (i = 0; i < 100; i++) { bar(); skip: } } ttyp0:bde@besplex:/tmp> gcc -c z.c ttyp0:bde@besplex:/tmp> gcc -c -pedantic z.c z.c: In function `foo': z.c:10: warning: ANSI C forbids label at end of compound statement ttyp0:bde@besplex:/tmp> tcc -c z.c "z.c", line 9: Error: [Syntax]: Parse error before '}'. "z.c", line 10: Error: [Syntax]: Parse error before '}'. [Syntax]: Can't recover from this error. ttyp0:bde@besplex:/tmp> exit Script done on Sun Apr 28 04:21:21 2002 %%% tcc normally gives references to ISO C90, but here it is confused too the syntax error. The syntax error is just that labels must be followed by a statement (there is no such thing as a label by itself; the syntax only defines labeled statements). "} after "skip:" is not a statement. The closest to a null statement is ";" or "{}". Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message