unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Ashish SHUKLA <ashish.is@lostca.se>
Cc: emacs@FreeBSD.org, emacs-devel@gnu.org
Subject: Re: Problem building Emacs b1fe27d with clang/LLVM 10.x
Date: Sat, 23 May 2020 12:58:13 -0700	[thread overview]
Message-ID: <cee3892f-814d-a048-a8be-65c1e380e00a@cs.ucla.edu> (raw)
In-Reply-To: <f887addd-960a-05ed-64a3-cde8d6fc2ccc@lostca.se>

[-- Attachment #1: Type: text/plain, Size: 506 bytes --]

On 5/23/20 12:23 PM, Ashish SHUKLA wrote:

> error: fallthrough annotation does not directly precede switch label

Argh. This appears to be fallout from the C2X draft spec for fallthrough, which
is more restrictive than GCC's (or than Clang 9's, apparently).

> -	  FALLTHROUGH;
>  	resetfvdef:

That patch isn't right, as it causes GCC to warn about the missing FALLTHROUGH.

I installed the attached patch instead, as it should be portable to C2X. Please
give it a try, and thanks for reporting the bug.

[-- Attachment #2: 0001-Port-etags-FALLTHROUGH-to-C2X.patch --]
[-- Type: text/x-patch, Size: 942 bytes --]

From e021c2dc2279e0fd3a5331f9ea661e4d39c2e840 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sat, 23 May 2020 12:55:13 -0700
Subject: [PATCH] Port etags FALLTHROUGH to C2X

Problem reported by Ashish SHUKLA in:
https://lists.gnu.org/r/emacs-devel/2020-05/msg03013.html
* lib-src/etags.c (C_entries): Move label so that FALLTHROUGH
precedes a case label, as draft C2X specifies.
---
 lib-src/etags.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib-src/etags.c b/lib-src/etags.c
index eee2c59626..4672e3491d 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -4197,9 +4197,9 @@ C_entries (int c_ext, FILE *inf)
 	      break;
 	    }
 	  FALLTHROUGH;
-	resetfvdef:
 	case '#': case '~': case '&': case '%': case '/':
 	case '|': case '^': case '!': case '.': case '?':
+	resetfvdef:
 	  if (definedef != dnone)
 	    break;
 	  /* These surely cannot follow a function tag in C. */
-- 
2.17.1


  reply	other threads:[~2020-05-23 19:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-23 19:23 Problem building Emacs b1fe27d with clang/LLVM 10.x Ashish SHUKLA
2020-05-23 19:58 ` Paul Eggert [this message]
2020-05-23 21:29   ` Ashish SHUKLA

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cee3892f-814d-a048-a8be-65c1e380e00a@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=ashish.is@lostca.se \
    --cc=emacs-devel@gnu.org \
    --cc=emacs@FreeBSD.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).