Subject: bug#41348: emacs compilation with clang10 fails in the file lib-src/etags.c

From: Narayanan Nellayi <[email-masked]>
Date: Sun, 17 May 2020 12:32:39 +0530

Hi,

emacs compilation with clang10 on Ubuntu 20.04 (focal release) fails with
an error in the file lib-src/etags.c. I am able to fix the issue with a
one-line change. This compilation failure is seen on the emacs src from
top-of-the-master-branch.

Pls see if this fix is appropriate and consider accordingly.

I have given below the details on the issue and a patch description.

Regards
Narayanan

clang --version
> clang version 10.0.0-4ubuntu1
> Target: x86_64-pc-linux-gnu
> Thread model: posix
> InstalledDir: /usr/bin
>

> make -C lib-src all
> make[1]: Entering directory
> '/mnt/myvg_fs/home/anarayan/sources/emacs/lib-src'
>   CCLD     etags
> error: fallthrough annotation does not directly precede switch label
> 1 error generated.
> make[1]: *** [Makefile:366: etags] Error 1
> make[1]: Leaving directory
> '/mnt/myvg_fs/home/anarayan/sources/emacs/lib-src'
> make: *** [Makefile:411: lib-src] Error 2
>

> diff --git a/lib-src/etags.c b/lib-src/etags.c
> index eee2c59626..b5f077007b 100644
> --- a/lib-src/etags.c
> +++ b/lib-src/etags.c
> @@ -4196,7 +4196,7 @@ C_entries (int c_ext, FILE *inf)
>        objdef = omethodsign;
>        break;
>      }
> -  FALLTHROUGH;
> +  // FALLTHROUGH;
>   resetfvdef:
>   case '#': case '~': case '&': case '%': case '/':
>   case '|': case '^': case '!': case '.': case '?':
>