Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Apr 2002 12:11:35 -0700
From:      Marcel Moolenaar <marcel@xcllnt.net>
To:        Bruce Evans <bde@zeta.org.au>
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>
In-Reply-To: <20020428042233.E1235-100000@gamplex.bde.org>
References:  <20020427181656.GA315@dhcp01.pn.xcllnt.net> <20020428042233.E1235-100000@gamplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020427191135.GB315>