On Sat, Jul 28, 2018 at 10:22:35AM -0700, Bruce Korb wrote:
> ../../autoopts/makeshell.c: In function ‘text_to_var’:
> ../../autoopts/makeshell.c:324:14: error: this statement may fall
> through [-Werror=implicit-fallthrough=]
>              (*(opts->pUsageProc))(opts, EXIT_SUCCESS);
>              ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> This warning goes away if the comment "/* FALLTHROUGH */ is present.
> You are missing a condition:
> 
>         switch (which) {
>         case TT_LONGUSAGE:
>             (*(opts->pUsageProc))(opts, EXIT_SUCCESS);
>             /* NOTREACHED */
> 
> Please add the exception for a "/* NOTREACHED */" comment. Thank you.

NOTREACHED means something different, and I don't think we want to add
support for this when we already support a way (including a standard way) to
mark function pointers noreturn (noreturn attribute, _Noreturn in C).
Or you can use -Wimplicit-fallthrough=1 where any kind of comment no matter
what you say there will disable the implicit fallthrough warning.

        Jakub

Reply via email to