From 8bc1c6e3e8c0a84ee656d1e1d68530fc9bf2e35d Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Thu, 15 Feb 2018 23:17:04 -0800 Subject: 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 Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris --- plugins/epan/mate/mate_parser.l | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'plugins') diff --git a/plugins/epan/mate/mate_parser.l b/plugins/epan/mate/mate_parser.l index b2ff7117cc..339b0cc4a2 100644 --- a/plugins/epan/mate/mate_parser.l +++ b/plugins/epan/mate/mate_parser.l @@ -84,13 +84,10 @@ #include -DIAG_OFF(sign-compare) - -#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 +/* + * Disable diagnostics in the code generated by Flex. + */ +DIAG_OFF_FLEX void MateParseTrace(FILE*,char*); @@ -337,7 +334,10 @@ blk_cmnt_stop "*/" %% -DIAG_ON(sign-compare) +/* + * Turn diagnostics back on, so we check the code that we've written. + */ +DIAG_ON_FLEX extern gboolean mate_load_config(const gchar* filename, mate_config* mc) { FILE *in; -- cgit v1.2.3