From a60a9e30717e94c293ede74b2666325558d158a1 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Tue, 18 Sep 2018 06:12:36 +0200 Subject: [PATCH] glr.c: work around ICC limitations The CI is littered with # -*- compilation -*- 423. regression.at:907: testing Dancer %glr-parser ... ./regression.at:907: bison -fno-caret -o dancer.c dancer.y ./regression.at:907: $BISON_C_WORKS stderr: stdout: ./regression.at:907: $CC $CFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.c $LIBS stderr: icc: command line warning #10006: ignoring unknown option '-Wcast-align' icc: command line warning #10006: ignoring unknown option '-fparse-all-comments' icc: command line warning #10006: ignoring unknown option '-Wdocumentation' icc: command line warning #10006: ignoring unknown option '-Wnull-dereference' icc: command line warning #10006: ignoring unknown option '-Wbad-function-cast' icc: command line warning #10006: ignoring unknown option '-fno-color-diagnostics' icc: command line warning #10006: ignoring unknown option '-Wno-keyword-macro' dancer.c(755): error #1628: function declared with "noreturn" does return } ^ dancer.c(761): error #1628: function declared with "noreturn" does return } ^ compilation aborted for dancer.c (code 2) ICC sees that `longjmp(buf, 1);` does not return, it sees that `abort();` does not either, but fails to see it for `longjmp(buf, 1); abort();` * data/glr.c (YYLONGJMP): Be even clearer on the fact this does not return. --- data/glr.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/data/glr.c b/data/glr.c index 8d93b148..386dff0f 100644 --- a/data/glr.c +++ b/data/glr.c @@ -305,8 +305,12 @@ b4_percent_code_get[]dnl # include # define YYJMP_BUF jmp_buf # define YYSETJMP(Env) setjmp (Env) -/* Pacify clang. */ -# define YYLONGJMP(Env, Val) (longjmp (Env, Val), YYASSERT (0)) +/* Pacify Clang and ICC. */ +# define YYLONGJMP(Env, Val) \ + do { \ + longjmp (Env, Val); \ + YYASSERT (0); \ + } while (yyfalse) #endif ]b4_attribute_define[