Fix extra semicolon outside of a function in NO_SANITIZE
``` internal/sanitizers.h:57:26: error: ISO C does not allow extra ‘;’ outside of a function [-Wpedantic] 57 | COMPILER_WARNING_PUSH; \ | ^ ``` and so many. Remove semicolons following pragma, and repeat the given declaration at the end to consume a semicolon following the macro call. As many `NO_SANITIZE` calls including bigdecimal that is a gem have a trailing semicolon, it was not able to move the semicolon inside `NO_SANITIZE`.
This commit is contained in:
parent
1f39184bc7
commit
8ba2c3109c
@ -54,10 +54,11 @@
|
||||
# include "internal/warnings.h"
|
||||
# undef NO_SANITIZE
|
||||
# define NO_SANITIZE(x, y) \
|
||||
COMPILER_WARNING_PUSH; \
|
||||
COMPILER_WARNING_IGNORED(-Wattributes); \
|
||||
COMPILER_WARNING_PUSH \
|
||||
COMPILER_WARNING_IGNORED(-Wattributes) \
|
||||
__attribute__((__no_sanitize__(x))) y; \
|
||||
COMPILER_WARNING_POP
|
||||
COMPILER_WARNING_POP \
|
||||
y
|
||||
#endif
|
||||
|
||||
#ifndef NO_SANITIZE
|
||||
|
@ -154,7 +154,8 @@ nonempty_memcpy(void *dest, const void *src, size_t n)
|
||||
_Pragma("GCC diagnostic push") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wattributes\"") \
|
||||
__attribute__((__no_sanitize__(x))) y; \
|
||||
_Pragma("GCC diagnostic pop")
|
||||
_Pragma("GCC diagnostic pop") \
|
||||
y
|
||||
#endif
|
||||
|
||||
#ifndef NO_SANITIZE
|
||||
|
Loading…
x
Reference in New Issue
Block a user