bug-gperf
[Top][All Lists]
Advanced

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

Re: [bug-gperf] switch fallthrough


From: Phil Willoughby
Subject: Re: [bug-gperf] switch fallthrough
Date: Thu, 26 Jul 2018 18:44:03 +0000

Hi Bruno, Marcel,

Thanks for working on this. While that patch fixes the problem with GCC7, 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.

I've attached a patch with the command-line variant to the pre-existing bug 
report at https://savannah.gnu.org/bugs/index.php?53029. This allows us to use 
our custom macro and have warning-free builds on clang/msvc/etc as well as GCC.

Phil

On 7/26/18, 3:14 AM, "Schaible, Marcel" <address@hidden> wrote:

    Hi Bruno,
    
    
    thanks for the quick patch!
    
    
    Kind regards
    
    
    Marcel
    
    
    ________________________________
    From: bug-gperf <address@hidden> on behalf of Bruno Haible <address@hidden>
    Sent: Thursday, July 26, 2018 2:05 AM
    To: address@hidden
    Cc: Phil Willoughby
    Subject: Re: [bug-gperf] switch fallthrough
    
    Hi,
    
    Phil Willoughby wrote:
    > We would like a way to change what gperf emits when it’s falling through
    > from one case to another in a switch block. At the moment we see
    > /*FALLTHOUGH*/ and I did not find a command-line flag or inline 
declaration
    > that can alter that.
    >
    > The reason we’d like this is that we’re migrating to GCC 7 from 5 and
    > we’re using the gcc flag -Werror=implicit-fallthrough.
    
    Thanks for the suggestion. It's even possible to avoid the 
implicit-fallthrough
    warnings without a command-line option or inline declaration.
    
    Implemented through this patch:
    
http://git.savannah.gnu.org/gitweb/?p=gperf.git;a=commitdiff;h=0d37a8763d9a5169ee2cb71a0281f859ca159b87
    
    Bruno
    
    
    


reply via email to

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