bug-gperf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gperf] switch fallthrough


From: Bruno Haible
Subject: Re: [bug-gperf] switch fallthrough
Date: Fri, 27 Jul 2018 01:48:41 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-130-generic; KDE/5.18.0; x86_64; ; )

Phil Willoughby wrote:
> it is less flexible than the command-line flag in that it doesn't work
> for other modern compilers and static analysis tools unless they use
> a C++17 standard library or impersonate GCC.

The idea of a command-line option is not good:

  * For packages that are distributed as a tarball (like all the software
    from ftp.gnu.org), it is the maintainer who creates the tarball who
    invokes gperf. But it is the builder, who takes the tarball who
    decides which compiler to use.

  * For packages that are distributed as a git repo, the gperf invocation
    is part of the autogen.sh script or some Makefile. The need to pass
    options that depend on the compiler means additional Makefile complexity.

However, if you can name a specific compiler where the current code still
produces fallthrough warnings, I would consider extending the #if cascade
to cover this compiler as well.

Static analysis tools should understand the comment syntax /*FALLTHROUGH*/.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]