From 31f3baed07fd292cdc604f6abd35d4caee3c6053 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 20 Mar 2018 21:47:55 -0700 Subject: Suppress warnings in Flex-generated code. --- diag-control.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'diag-control.h') diff --git a/diag-control.h b/diag-control.h index ca86f6be..72ded1c3 100644 --- a/diag-control.h +++ b/diag-control.h @@ -37,6 +37,19 @@ #include "pcap/compiler-tests.h" +/* + * Suppress Flex warnings. + */ +#if defined(_MSC_VER) + #define DIAG_OFF_FLEX \ + __pragma(warning(push)) \ + __pragma(warning(disable:4127)) + #define DIAG_ON_FLEX __pragma(warning(pop)) +#else + #define DIAG_OFF_FLEX + #define DIAG_ON_FLEX +#endif + #ifdef YYBYACC /* * Berkeley YACC. -- cgit v1.2.1