unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Problem building Emacs b1fe27d with clang/LLVM 10.x
@ 2020-05-23 19:23 Ashish SHUKLA
  2020-05-23 19:58 ` Paul Eggert
  0 siblings, 1 reply; 3+ messages in thread
From: Ashish SHUKLA @ 2020-05-23 19:23 UTC (permalink / raw)
  To: emacs-devel; +Cc: emacs


[-- Attachment #1.1: Type: text/plain, Size: 2300 bytes --]

Hi,

I am one of the maintainers of editors/emacs-devel FreeBSD port. Future
releases of FreeBSD (12-STABLE, or -CURRENT) will have LLVM 10.x as the
base compiler toolchain. We received reports[1][2] of Emacs build
failing with them:

Following is an excerpt from the build log:

=========================================================

gmake[2]: Entering directory
'/wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-b1fe27d/lib-src'
cc   -Wno-switch -Wno-pointer-sign -Wno-string-plus-int
-Wno-unknown-attributes -Wno-initializer-overrides
-Wno-tautological-compare
-Wno-tautological-constant-out-of-range-compare  -I. -I../src -I../lib
-I. -I./../src -I./../lib  -fstack-protector-strong -L/usr/local/lib
-L/usr/local/lib -isystem /usr/local/include -O2 -pipe
-fstack-protector-strong -isystem /usr/local/include
-fno-strict-aliasing  -o etags etags.c  ../lib/libgnu.a -lutil
error: fallthrough annotation does not directly precede switch label
makeinfo --force -I./../emacs --no-split  \
  -o ../../info/bovine.info bovine.texi
1 error generated.
gmake[2]: *** [Makefile:366: etags] Error 1
gmake[2]: Leaving directory
'/wrkdirs/usr/ports/editors/emacs-devel/work-full/emacs-b1fe27d/lib-src'
gmake[1]: *** [Makefile:411: lib-src] Error 2
/bin/mkdir -p ./info
gmake[1]: *** Waiting for unfinished jobs....

=========================================================

As a workaround for this problem I have locally implemented following
diff which seem to have fixed the issue:

--- lib-src/etags.c.orig	2020-05-18 16:17:29 UTC
+++ lib-src/etags.c
@@ -4196,7 +4196,6 @@ C_entries (int c_ext, FILE *inf)
 	      objdef = omethodsign;
 	      break;
 	    }
-	  FALLTHROUGH;
 	resetfvdef:
 	case '#': case '~': case '&': case '%': case '/':
 	case '|': case '^': case '!': case '.': case '?':


My C/C++-fu is very outdated. I'm wondering if any of the Emacs
developers have any better fixes for the problem. If you like I can file
a bug report for the same.

Also, as I'm not subscribed to the list, if you could please Cc me, and
emacs@FreeBSD.org in your replies.

References:
[1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246525
[2] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246668

Thanks!
-- 
Ashish SHUKLA


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Problem building Emacs b1fe27d with clang/LLVM 10.x
  2020-05-23 19:23 Problem building Emacs b1fe27d with clang/LLVM 10.x Ashish SHUKLA
@ 2020-05-23 19:58 ` Paul Eggert
  2020-05-23 21:29   ` Ashish SHUKLA
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Eggert @ 2020-05-23 19:58 UTC (permalink / raw)
  To: Ashish SHUKLA; +Cc: emacs, emacs-devel

[-- 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: Problem building Emacs b1fe27d with clang/LLVM 10.x
  2020-05-23 19:58 ` Paul Eggert
@ 2020-05-23 21:29   ` Ashish SHUKLA
  0 siblings, 0 replies; 3+ messages in thread
From: Ashish SHUKLA @ 2020-05-23 21:29 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs, emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 657 bytes --]

On 5/24/20 1:28 AM, Paul Eggert wrote:
> 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.
> 

Thank you, that built fine with clang10.

-- 
Ashish SHUKLA


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-23 21:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-23 19:23 Problem building Emacs b1fe27d with clang/LLVM 10.x Ashish SHUKLA
2020-05-23 19:58 ` Paul Eggert
2020-05-23 21:29   ` Ashish SHUKLA

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).