diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-02-15 23:17:04 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-02-16 10:35:10 +0000 |
commit | 8bc1c6e3e8c0a84ee656d1e1d68530fc9bf2e35d (patch) | |
tree | 92c288690894a1f68257711ee594a7da985a7aa9 /epan/radius_dict.l | |
parent | b6bec7d1fdf537f12968276344e6191394249b8b (diff) |
Add DIAG_OFF_FLEX and DIAG_ON_FLEX for use in Flex scanners.
DIAG_OFF_FLEX turns off all warnings that we want to disable for
Flex-generated code due to some versions of Flex generating code that
triggers those warnings.
DIAG_ON_FLEX restores those warnings, so we do the checks for code that
*we* wrote.
Use them in .l files.
Change-Id: I613a20309a30cd4c61111a1edbe27a5d05fcbf59
Reviewed-on: https://code.wireshark.org/review/25815
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/radius_dict.l')
-rw-r--r-- | epan/radius_dict.l | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/epan/radius_dict.l b/epan/radius_dict.l index 043c91e9ad..05bfb92585 100644 --- a/epan/radius_dict.l +++ b/epan/radius_dict.l @@ -92,7 +92,10 @@ #include <epan/dissectors/packet-radius.h> #include <wsutil/file_util.h> -DIAG_OFF(sign-compare) +/* + * Disable diagnostics in the code generated by Flex. + */ +DIAG_OFF_FLEX /* * See @@ -120,12 +123,6 @@ DIAG_OFF(sign-compare) */ #define YY_USER_INIT BEGIN WS_OUT; -#ifdef _WIN32 -/* disable Windows VC compiler warning "signed/unsigned mismatch" associated */ -/* with YY_INPUT code generated by flex versions such as 2.5.35. */ -#pragma warning (disable:4018) -#endif - #define ECHO #define MAX_INCLUDE_DEPTH 10 @@ -412,7 +409,10 @@ static void add_value(Radius_scanner_state_t* state, const gchar* attrib_name, c %% -DIAG_ON(sign-compare) +/* + * Turn diagnostics back on, so we check the code that we've written. + */ +DIAG_ON_FLEX static void add_vendor(Radius_scanner_state_t* state, const gchar* name, guint32 id, guint type_octets, guint length_octets, gboolean has_flags) { radius_vendor_info_t* v; |