From fb2443daaaab9a39a4137d09084fa3d5fdb66ce2 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 11 Apr 2014 12:42:26 +0100 Subject: [PATCH] Fix the build for gcc on os x: gcc warns about the missing return in protcatchthread, but we don't want to add one because that would be unreachable code. so use __attribute__((__noreturn__)) instead. Copied from Perforce Change: 185461 ServerID: perforce.ravenbrook.com --- mps/code/config.h | 10 ++++++++++ mps/code/protxc.c | 1 + 2 files changed, 11 insertions(+) diff --git a/mps/code/config.h b/mps/code/config.h index e29127c153c..b781f1da591 100644 --- a/mps/code/config.h +++ b/mps/code/config.h @@ -231,6 +231,16 @@ #define ATTRIBUTE_NO_SANITIZE_ADDRESS #endif +/* Attribute for functions that do not return. + * GCC: + * Clang: + */ +#if defined(MPS_BUILD_GC) || defined(MPS_BUILD_LL) +#define ATTRIBUTE_NORETURN __attribute__((__noreturn__)) +#else +#define ATTRIBUTE_NORETURN +#endif + /* EPVMDefaultSubsequentSegSIZE is a default for the alignment of * subsequent segments (non-initial at each save level) in EPVM. See diff --git a/mps/code/protxc.c b/mps/code/protxc.c index 8f62bb3a5df..58dee81a179 100644 --- a/mps/code/protxc.c +++ b/mps/code/protxc.c @@ -282,6 +282,7 @@ static void protCatchOne(void) * handler won't cause a deadlock. */ +ATTRIBUTE_NORETURN static void *protCatchThread(void *p) { UNUSED(p); for (;;)