This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] libiberty: Fix -Wimplicit-fallthrough warnings.
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Mark Wielaard <mjw at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 2 Nov 2016 14:24:02 +0100
- Subject: Re: [PATCH] libiberty: Fix -Wimplicit-fallthrough warnings.
- Authentication-results: sourceware.org; auth=none
- References: <1478092773-20629-1-git-send-email-mjw@redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Nov 02, 2016 at 02:19:33PM +0100, Mark Wielaard wrote:
> Adjust some comments, add some explicit fall through comments or explicit
> returns where necessary to not get implicit-fallthrough warnings.
>
> All fall throughs were deliberate. In one case I added an explicit return
> false for clarity instead of falling through a default case (that also
> would return false).
>
> libiberty/ChangeLog:
>
> * cplus-dem.c (demangle_signature): Move fall through comment.
> (demangle_fund_type): Add fall through comment between 'G' and 'I'.
> * hashtab.c (iterative_hash): Add fall through comments.
> * regex.c (regex_compile): Add Fall through comment after '+'/'?'.
> (byte_re_match_2_internal): Add Fall through comment after jump_n.
> Change "Note fall through" to "Fall through".
> (common_op_match_null_string_p): Return false after set_number_at
> instead of fall through.
LGTM, except for:
> --- a/libiberty/cplus-dem.c
> +++ b/libiberty/cplus-dem.c
> @@ -1658,8 +1658,8 @@ demangle_signature (struct work_stuff *work,
> break;
> }
> else
> - /* fall through */
> {;}
> + /* fall through */
I think you should just remove the else and {;} and just have fallthrough
comment indented where else used to be.
Jakub