Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: This statement may fall through - how?
Date: Wed, 29 Apr 2020 17:58:30 -0700
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <86sgglpz61.fsf@linuxsc.com>
References:
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader02.eternal-september.org; posting-host="e63eb88c308ee37e50bf550bb90bc04a"; logging-data="4385"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/1vxBuafQXw3NniUW48X7CyRH/r9e0jPM="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:/yfzUydxj4YJwkW/hPUECZqh4sg= sha1:1uYplPCSZti9PyE9xbsLOuISPuk=
Xref: csiph.com comp.lang.c:151802
mathog writes:
> [..warning 'statement may fall through'..]
>
> [...] Is there really some way that usage() can
> avoid hitting exit() or is the compiler just emitting a general
> warning without actually looking at usage()?
>
> void usage()
> {
> printf("%s",usage_string);
> exit(0);
> }
>
> [call to 'usage()' just before a 'case' label]
_Noreturn void usage(){ ... }
gcc-8 -std=c11 -pedantic-errors -Wall -Wextra ...