linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.2.18 signal.h
@ 2000-12-15 16:29 Mike Black
  2000-12-15 16:56 ` Andrea Arcangeli
  0 siblings, 1 reply; 25+ messages in thread
From: Mike Black @ 2000-12-15 16:29 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.or

include/linux/signal.h

There's a couple like this -- isn't this case statement upside down???

extern inline void siginitset(sigset_t *set, unsigned long mask)
{
        set->sig[0] = mask;
        switch (_NSIG_WORDS) {
        default:
                memset(&set->sig[1], 0, sizeof(long)*(_NSIG_WORDS-1));
                break;
        case 2: set->sig[1] = 0;
        case 1:
        }
}

gcc is complaining:
/usr/src/linux/include/linux/signal.h:193: warning: deprecated use of label
at end of compound statement

________________________________________
Michael D. Black   Principal Engineer
mblack@csihq.com  321-676-2923,x203
http://www.csihq.com  Computer Science Innovations
http://www.csihq.com/~mike  My home page
FAX 321-676-2355

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 25+ messages in thread
* Re: 2.2.18 signal.h
@ 2000-12-15 21:56 Jesse Pollard
  2000-12-15 22:22 ` Andrea Arcangeli
  0 siblings, 1 reply; 25+ messages in thread
From: Jesse Pollard @ 2000-12-15 21:56 UTC (permalink / raw)
  To: andrea, Ulrich Drepper; +Cc: linux-kernel@vger.kernel.or

---------  Received message begins Here  ---------

> From: Andrea Arcangeli <andrea@suse.de>
> On Fri, Dec 15, 2000 at 11:18:35AM -0800, Ulrich Drepper wrote:
> > Andrea Arcangeli <andrea@suse.de> writes:
> > 
> > > x()
> > > {
> > > 
> > > 	switch (1) {
> > > 	case 0:
> > > 	case 1:
> > > 	case 2:
> > > 	case 3:
> > > 	;
> > > 	}
> > > }
> > > 
> > > Why am I required to put a `;' only in the last case and not in all
> > > the previous ones? Or maybe gcc-latest is forgetting to complain about
> > > the previous ones ;)
> > 
> > Your C language knowledge seems to have holes.  It must be possible to
> > have more than one label for a statement.  Look through the kernel
> > sources, there are definitely cases where this is needed.
> 
> I don't understand what you're talking about. Who ever talked about "more than
> one label"?
> 
> The only issue here is having 1 random label at the end of a compound
> statement. Nothing else.

The label must be on an expression. Until the ";" is present to indicate
a null expression it is syntacticly incorrect to have

switch (x) {
1:
2: something;
3:
}

The "3:" needs an expression to satisfy the syntax of "switch".

> And yes I can see that the whole point of the change is that they want
> to also forbids this:
> 
> x()
> {
> 	goto out;
> out:
> }
> 
> and I dislike not being allowed to do the above as well infact ;).

I think this has the same requirement. A null expression, specified with
the ";" is a small price to pay for simplifying the error detection.

-------------------------------------------------------------------------
Jesse I Pollard, II
Email: pollard@navo.hpc.mil

Any opinions expressed are solely my own.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2001-01-02 17:27 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-15 16:29 2.2.18 signal.h Mike Black
2000-12-15 16:56 ` Andrea Arcangeli
2000-12-15 17:07   ` Richard B. Johnson
2000-12-15 17:43     ` Andrea Arcangeli
2000-12-15 17:59   ` Franz Sirl
2000-12-15 18:34     ` Richard B. Johnson
2000-12-15 18:50       ` Alan Cox
2000-12-15 19:06       ` Horst von Brand
2000-12-15 20:15         ` Michael Meissner
2000-12-15 18:54     ` Andrea Arcangeli
2000-12-15 19:18       ` Ulrich Drepper
2000-12-15 19:57         ` Andrea Arcangeli
2000-12-15 20:09           ` Rik van Riel
2000-12-15 20:22             ` Andrea Arcangeli
2000-12-16  7:53           ` Anuradha Ratnaweera
2000-12-16 13:52             ` Andrea Arcangeli
2000-12-19 16:53               ` Michael Meissner
2000-12-15 19:55       ` Rik van Riel
2000-12-15 20:14         ` Andrea Arcangeli
2000-12-21 18:18           ` Thomas Dodd
2001-01-02 16:55             ` Andrea Arcangeli
2000-12-15 20:31       ` Michael Meissner
2000-12-17  5:27         ` Albert D. Cahalan
2000-12-15 21:56 Jesse Pollard
2000-12-15 22:22 ` Andrea Arcangeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).