diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-09-11 03:42:56 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-09-11 10:43:36 +0000 |
commit | f94cfa0cdc37955a5c68687af01bf4ad35ce27bd (patch) | |
tree | 1d6755b54b911bfeb141ba0655604f2bed77d85e /epan/wslua | |
parent | 4df2fcb0eef156b40bd3ffd37df0da2885293094 (diff) |
Some older compilers don't allow diagnostic pragmas inside a function.
Change-Id: I7ed32cfdd1c7a308acf5ef2cca9fde28dda5563e
Reviewed-on: https://code.wireshark.org/review/29600
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/wslua')
-rw-r--r-- | epan/wslua/lua_bitop.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/epan/wslua/lua_bitop.c b/epan/wslua/lua_bitop.c index 27d92bc993..012977ba2b 100644 --- a/epan/wslua/lua_bitop.c +++ b/epan/wslua/lua_bitop.c @@ -145,6 +145,7 @@ static const struct luaL_Reg bit_funcs[] = { */ #define BAD_SAR (bsar(-8, 2) != (SBits)-2) +DIAG_OFF(unreachable-code) LUALIB_API int luaopen_bit(lua_State *L) { UBits b; @@ -160,10 +161,8 @@ LUALIB_API int luaopen_bit(lua_State *L) if (b == (UBits)1127743488L) msg = "not compiled with SWAPPED_DOUBLE"; #endif -DIAG_OFF(unreachable-code) if (BAD_SAR) msg = "arithmetic right-shift broken"; -DIAG_ON(unreachable-code) luaL_error(L, "bit library self-test failed (%s)", msg); } #if LUA_VERSION_NUM < 502 @@ -175,4 +174,4 @@ DIAG_ON(unreachable-code) return 0; /* changed from 1 to 0 for wireshark, since lua_setglobal now pops the table */ #endif } - +DIAG_ON(unreachable-code) |