mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
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.
This commit is contained in:
@@ -305,8 +305,12 @@ b4_percent_code_get[]dnl
|
||||
# include <setjmp.h>
|
||||
# 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[
|
||||
|
||||
Reference in New Issue
Block a user