Re: 2.2.18 signal.h

From: Rik van Riel (riel@conectiva.com.br)
Date: Fri Dec 15 2000 - 14:55:08 EST


On Fri, 15 Dec 2000, Andrea Arcangeli wrote:

> 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?

That `;' above is NOT in just the last one. In your above
example, all the labels will execute the same `;' statement.

In fact, the default behaviour of the switch() operation is
to fall through to the next defined label and you have to put
in an explicit `break;' if you want to prevent `case 0:' from
reaching the `;' below the `case 3:'...

regards,

Rik

--
Hollywood goes for world dumbination,
	Trailer at 11.

http://www.surriel.com/ http://www.conectiva.com/ http://distro.conectiva.com.br/

- 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/



This archive was generated by hypermail 2b29 : Fri Dec 15 2000 - 21:00:33 EST