From owner-cvs-all Sat Apr 27 12:11:32 2002 Delivered-To: cvs-all@freebsd.org Received: from kayak.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by hub.freebsd.org (Postfix) with ESMTP id AC7D037B416; Sat, 27 Apr 2002 12:11:26 -0700 (PDT) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by kayak.xcllnt.net (8.11.6/8.11.4) with ESMTP id g3RJBOJ81926; Sat, 27 Apr 2002 12:11:24 -0700 (PDT) (envelope-from marcel@kayak.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.2/8.12.2) with ESMTP id g3RJBZQi000581; Sat, 27 Apr 2002 12:11:35 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.2/8.12.2/Submit) id g3RJBZQS000580; Sat, 27 Apr 2002 12:11:35 -0700 (PDT) Date: Sat, 27 Apr 2002 12:11:35 -0700 From: Marcel Moolenaar To: Bruce Evans Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern subr_witness.c Message-ID: <20020427191135.GB315@dhcp01.pn.xcllnt.net> References: <20020427181656.GA315@dhcp01.pn.xcllnt.net> <20020428042233.E1235-100000@gamplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020428042233.E1235-100000@gamplex.bde.org> User-Agent: Mutt/1.3.27i 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 Sun, Apr 28, 2002 at 04:34:03AM +1000, Bruce Evans wrote: > > > > 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. > 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 But GCC doesn't complain about a syntax error. It just tells me that a certain standard is incompatible with the language GCC accepts :-) > 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 "{}". Since I did insert a semi-colon, I guess what you are arguing is that the commit log is a bit silly. I think it's not silly enough that it's wrong, so I don't see a need for forced commit. Do you? Anyway: point taken. The construct was invalid and I didn't realize it. All I saw was a warning and the change I made was to fix the warning (exterior manifestation) and not the error (fundamental bug). Given this, a better fix would be to rewrite the nested FOREACH so that we don't need to have the label. This is not something I feel I should be doing though. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message