pytest.ini: declare minimum version requirement
[metze/wireshark/wip.git] / epan / dtd_preparse.l
index a3d169849f0ad9bd497a3523b7144c38be69fd78..669d1472969980d9d4691582a2a835e4c5f88245 100644 (file)
 #include "dtd.h"
 #include <wsutil/file_util.h>
 
+/*
+ * Disable diagnostics in the code generated by Flex.
+ */
+DIAG_OFF_FLEX
+
 #define ECHO g_string_append(yyextra->current,yytext);
 
 struct _dtd_preparse_scanner_state {
@@ -125,12 +130,6 @@ static const gchar* replace_entity(Dtd_PreParse_scanner_state_t* state, gchar* s
 #define YY_NO_UNISTD_H
 #endif
 
-#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
-
 /*
  * Sleazy hack to suppress compiler warnings in yy_fatal_error().
  */
@@ -210,6 +209,11 @@ newline    \n
 
 %%
 
+/*
+ * Turn diagnostics back on, so we check the code that we've written.
+ */
+DIAG_ON_FLEX
+
 static const gchar* replace_entity(Dtd_PreParse_scanner_state_t* state, gchar* entity) {
        GString* replacement;
 
@@ -229,7 +233,7 @@ static const gchar* replace_entity(Dtd_PreParse_scanner_state_t* state, gchar* e
 const gchar* dtd_location(Dtd_PreParse_scanner_state_t* state) {
        static gchar* loc = NULL;
 
-       if (loc) g_free(loc);
+       g_free(loc);
 
        if (!state) return NULL;