rts: Add FALLTHROUGH macro
Concern Raised6bb8aaa3b4fc

Authored by bgamari on Nov 2 2018, 1:25 PM.

Description

rts: Add FALLTHROUGH macro

Instead of using the GCC /* fallthrough */ syntax we now use the
__attribute__((fallthrough)), which Phyx says should be more portable
than the former.

Also adds a missing fallthrough annotation in the MachO linker,
fixing Trac #14613.

Reviewers: erikd, simonmar

Reviewed By: simonmar

Subscribers: rwbarton, carter

GHC Trac Issues: Trac #14613

Differential Revision: https://phabricator.haskell.org/D5292

Details

Auditors
harpocrates
Committed
bgamariNov 2 2018, 4:13 PM
Reviewer
simonmar
Differential Revision
D5292: rts: Add FALLTHROUGH macro
Parents
rGHC5f81952e230f: rts: Allow output filename of eventlog to be given by command-line
Branches
Unknown
Tags
Unknown
harpocrates raised a concern with this commit.Dec 2 2018, 2:41 PM
harpocrates added a subscriber: harpocrates.

I think this is what is causing Mac CI to fail (pretty early on). Example failure:

rts/sm/CNF.c:215:9: error:
421	     error: declaration does not declare anything [-Werror,-Wmissing-declarations]
422	            FALLTHROUGH;
423	            ^
424	    |
425	215 |         FALLTHROUGH;
426	    |         ^
427	
428	includes/Stg.h:201:21: error:
429	     note: expanded from macro 'FALLTHROUGH'
430	    |
431	201 | #define FALLTHROUGH GNU_ATTRIBUTE(fallthrough)
432	    |                     ^
433	#define FALLTHROUGH GNU_ATTRIBUTE(fallthrough)
434	                    ^
435	
436	includes/Stg.h:188:27: error:
437	     note: expanded from macro 'GNU_ATTRIBUTE'
438	    |
439	188 | #define GNU_ATTRIBUTE(at) __attribute__((at))
440	    |                           ^
441	#define GNU_ATTRIBUTE(at) __attribute__((at))
442	                          ^

I'm also able to reproduce the warnings locally on Mac.

This commit now has outstanding concerns.Dec 2 2018, 2:41 PM