diff options
author | João Valverde <j@v6e.pt> | 2022-11-19 22:52:09 +0000 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2022-11-20 10:11:27 +0000 |
commit | 79c3a77752bfee8e57cac3796d5e5ef1987e5612 (patch) | |
tree | dd903014caf5145faf5b220afa435d1b653044cf /epan/dtd_parse.l | |
parent | c4ca4312c1c17cf48a1e956d0cd2e6ab5e04d4f2 (diff) |
Add macros to control lemon diagnostics
Rename flex macros using parenthesis (mostly a style issue):
DIAG_OFF_FLEX -> DIAG_OFF_FLEX()
DIAG_ON_FLEX -> DIAG_ON_FLEX()
Use the same kind of construct with lemon generated code using
DIAG_OFF_LEMON() and DIAG_ON_LEMON(). Use %include and %code
directives to enforce the desired order with generated code
in the middle in between pragmas.
Fix a clang-specific pragma to use DIAG_OFF_CLANG().
DIAG_OFF(unreachable-code) -> DIAG_OFF_CLANG(unreachable-code).
Apparently GCC is ignoring the -Wunreachable flag, that's why
it did not trigger an unknown pragma warning. From [1}:
The -Wunreachable-code has been removed, because it was unstable: it
relied on the optimizer, and so different versions of gcc would warn
about different code. The compiler still accepts and ignores the
command line option so that existing Makefiles are not broken. In some
future release the option will be removed entirely. - Ian
[1] https://gcc.gnu.org/legacy-ml/gcc-help/2011-05/msg00360.html
Diffstat (limited to 'epan/dtd_parse.l')
-rw-r--r-- | epan/dtd_parse.l | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/dtd_parse.l b/epan/dtd_parse.l index f8da374c44..9d7677d8bf 100644 --- a/epan/dtd_parse.l +++ b/epan/dtd_parse.l @@ -92,7 +92,7 @@ /* * Disable diagnostics in the code generated by Flex. */ -DIAG_OFF_FLEX +DIAG_OFF_FLEX() struct _proto_xmlpi_attr { const gchar* name; @@ -353,7 +353,7 @@ squoted ['][^\']*['] /* * Turn diagnostics back on, so we check the code that we've written. */ -DIAG_ON_FLEX +DIAG_ON_FLEX() static dtd_token_data_t* new_token(gchar* text, gchar* location) { dtd_token_data_t* t = g_new(dtd_token_data_t,1); |