aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-09-12 16:29:24 +0000
committerGuy Harris <guy@alum.mit.edu>2018-09-12 16:29:30 +0000
commite31ca2e278614d7c21a7912641a274994ad80e70 (patch)
tree8dd7e758760c14c0748e7e03c0903d40e01cc9e5
parent0cb87b738982be7477364df49cd535b380a6ad6b (diff)
Revert "Some older compilers don't allow diagnostic pragmas inside a function."
This reverts commit f94cfa0cdc37955a5c68687af01bf4ad35ce27bd. Reason for revert: we don't use those diagnostic pragmas with those older compilers. Change-Id: I5154527dcc3813fb893c382059cb33538f2d29f7 Reviewed-on: https://code.wireshark.org/review/29639 Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r--epan/wslua/lua_bitop.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/epan/wslua/lua_bitop.c b/epan/wslua/lua_bitop.c
index 012977b..27d92bc 100644
--- a/epan/wslua/lua_bitop.c
+++ b/epan/wslua/lua_bitop.c
@@ -145,7 +145,6 @@ 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;
@@ -161,8 +160,10 @@ 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
@@ -174,4 +175,4 @@ LUALIB_API int luaopen_bit(lua_State *L)
return 0; /* changed from 1 to 0 for wireshark, since lua_setglobal now pops the table */
#endif
}
-DIAG_ON(unreachable-code)
+