summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-12-04 19:52:51 -0800
committerGuy Harris <guy@alum.mit.edu>2015-12-05 08:06:50 +0000
commitf51bad11d70b2548ed2cbf117b90bd9dbf1afedf (patch)
tree9db789d73c4958c3a792c6b10abcbb746318bcd8
parent42333aa353515ccbb68c6e74109cd34a34d1abe6 (diff)
downloadwireshark-f51bad11d70b2548ed2cbf117b90bd9dbf1afedf.tar.gz
Use noyywrap rather than defining our own yywrap functions.
Tweak lemonflex-tail.inc to fix an issue this reveals. It appears that, at least on the buildbots, the Visual Studio compiler no longer issues warnings for the code generated with %option noyywrap. Change-Id: Id64d56f1ae8a79d0336488a4a50518da1f511497 Reviewed-on: https://code.wireshark.org/review/12433 Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r--epan/dfilter/scanner.l5
-rw-r--r--epan/diam_dict.l18
-rw-r--r--epan/dtd_parse.l16
-rw-r--r--epan/dtd_preparse.l16
-rw-r--r--epan/radius_dict.l16
-rw-r--r--epan/uat_load.l18
-rw-r--r--plugins/mate/mate_parser.l16
-rw-r--r--plugins/wimaxasncp/wimaxasncp_dict.l16
-rw-r--r--text2pcap-scanner.l12
-rw-r--r--tools/lemon/lemonflex-tail.inc2
-rw-r--r--ui/text_import_scanner.l11
-rw-r--r--wiretap/ascend_scanner.l16
-rw-r--r--wiretap/k12text.l16
13 files changed, 62 insertions, 116 deletions
diff --git a/epan/dfilter/scanner.l b/epan/dfilter/scanner.l
index be45f7390c..c213ac8351 100644
--- a/epan/dfilter/scanner.l
+++ b/epan/dfilter/scanner.l
@@ -19,6 +19,11 @@
*/
%option prefix="df_"
+/*
+ * We're reading from a string, so we don't need yywrap.
+ */
+%option noyywrap
+
%{
/*
* Wireshark - Network traffic analyzer
diff --git a/epan/diam_dict.l b/epan/diam_dict.l
index 9a9bdacf36..9dccba9b97 100644
--- a/epan/diam_dict.l
+++ b/epan/diam_dict.l
@@ -24,6 +24,11 @@
%option stack
/*
+ * We want to stop processing when we get to the end of the input.
+ */
+%option noyywrap
+
+/*
* Prefix scanner routines with "DiamDict" rather than "yy", so this scanner
* can coexist with other scanners.
*/
@@ -820,19 +825,6 @@ ddict_print(FILE* fh, ddict_t* d)
}
}
-/*
- * We want to stop processing when we get to the end of the input.
- * (%option noyywrap is not used because if used then
- * some flex versions (eg: 2.5.35) generate code which causes
- * warnings by the Windows VC compiler).
- */
-
-int
-yywrap(void)
-{
- return 1;
-}
-
#ifdef TEST_DIAM_DICT_STANDALONE
int
main(int argc, char** argv)
diff --git a/epan/dtd_parse.l b/epan/dtd_parse.l
index 14e3b04e99..1c9554478a 100644
--- a/epan/dtd_parse.l
+++ b/epan/dtd_parse.l
@@ -14,6 +14,11 @@
%option never-interactive
/*
+ * We want to stop processing when we get to the end of the input.
+ */
+%option noyywrap
+
+/*
* Prefix scanner routines with "Dtd_Parse_" rather than "yy", so this scanner
* can coexist with other scanners.
*/
@@ -367,14 +372,3 @@ extern dtd_build_data_t* dtd_parse(GString* s) {
return build_data;
}
-
-/*
- * We want to stop processing when we get to the end of the input.
- * (%option noyywrap is not used because if used then
- * some flex versions (eg: 2.5.35) generate code which causes
- * warnings by the Windows VC compiler).
- */
-
-int yywrap(void) {
- return 1;
-}
diff --git a/epan/dtd_preparse.l b/epan/dtd_preparse.l
index 306e5d8f5a..5188fbae02 100644
--- a/epan/dtd_preparse.l
+++ b/epan/dtd_preparse.l
@@ -14,6 +14,11 @@
%option never-interactive
/*
+ * We want to stop processing when we get to the end of the input.
+ */
+%option noyywrap
+
+/*
* The language we're scanning is case-insensitive.
*/
%option caseless
@@ -230,14 +235,3 @@ extern GString* dtd_preparse(const gchar* dname,const gchar* fname, GString* er
return output;
}
-
-/*
- * We want to stop processing when we get to the end of the input.
- * (%option noyywrap is not used because if used then
- * some flex versions (eg: 2.5.35) generate code which causes
- * warnings by the Windows VC compiler).
- */
-
-int yywrap(void) {
- return 1;
-}
diff --git a/epan/radius_dict.l b/epan/radius_dict.l
index c043856626..ebbf2a060a 100644
--- a/epan/radius_dict.l
+++ b/epan/radius_dict.l
@@ -14,6 +14,11 @@
%option never-interactive
/*
+ * We want to stop processing when we get to the end of the input.
+ */
+%option noyywrap
+
+/*
* The language we're scanning is case-insensitive.
*/
%option caseless
@@ -641,17 +646,6 @@ gboolean radius_load_dictionary (radius_dictionary_t* d, gchar* dir, const gchar
}
/*
- * We want to stop processing when we get to the end of the input.
- * (%option noyywrap is not used because if used then
- * some flex versions (eg: 2.5.35) generate code which causes
- * warnings by the Windows VC compiler).
- */
-
-int yywrap(void) {
- return 1;
-}
-
-/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local variables:
diff --git a/epan/uat_load.l b/epan/uat_load.l
index 5c634f56aa..0f1ef93536 100644
--- a/epan/uat_load.l
+++ b/epan/uat_load.l
@@ -14,6 +14,11 @@
%option never-interactive
/*
+ * We want to stop processing when we get to the end of the input.
+ */
+%option noyywrap
+
+/*
* Prefix scanner routines with "uat_load_" rather than "yy", so this scanner
* can coexist with other scanners.
*/
@@ -375,16 +380,3 @@ uat_load_str(uat_t *uat_in, char *entry, char **err)
*err = NULL;
return TRUE;
}
-
-/*
- * We want to stop processing when we get to the end of the input.
- * (%option noyywrap is not used because if used then
- * some flex versions (eg: 2.5.35) generate code which causes
- * warnings by the Windows VC compiler).
- */
-
-int
-yywrap(void)
-{
- return 1;
-}
diff --git a/plugins/mate/mate_parser.l b/plugins/mate/mate_parser.l
index a3f609e505..865b8d138c 100644
--- a/plugins/mate/mate_parser.l
+++ b/plugins/mate/mate_parser.l
@@ -14,6 +14,11 @@
%option never-interactive
/*
+ * We want to stop processing when we get to the end of the input.
+ */
+%option noyywrap
+
+/*
* Prefix scanner routines with "Mate" rather than "yy", so this scanner
* can coexist with other scanners.
*/
@@ -339,14 +344,3 @@ extern gboolean mate_load_config(const gchar* filename, mate_config* matecfg) {
return state;
}
-
-/*
- * We want to stop processing when we get to the end of the input.
- * (%option noyywrap is not used because if used then
- * some flex versions (eg: 2.5.35) generate code which causes
- * warnings by the Windows VC compiler).
- */
-
-int yywrap(void) {
- return 1;
-}
diff --git a/plugins/wimaxasncp/wimaxasncp_dict.l b/plugins/wimaxasncp/wimaxasncp_dict.l
index 2c889b3a61..3953f1fe96 100644
--- a/plugins/wimaxasncp/wimaxasncp_dict.l
+++ b/plugins/wimaxasncp/wimaxasncp_dict.l
@@ -14,6 +14,11 @@
%option never-interactive
/*
+ * We want to stop processing when we get to the end of the input.
+ */
+%option noyywrap
+
+/*
* The language we're scanning is case-insensitive.
*/
%option caseless
@@ -727,17 +732,6 @@ void wimaxasncp_dict_print(FILE *fh, wimaxasncp_dict_t *d) {
}
}
-/*
- * We want to stop processing when we get to the end of the input.
- * (%option noyywrap is not used because if used then
- * some flex versions (eg: 2.5.35) generate code which causes
- * warnings by the Windows VC compiler).
- */
-
-int yywrap(void) {
- return 1;
-}
-
#ifdef TEST_WIMAXASNCP_DICT_STANDALONE
int main(int argc, char **argv) {
wimaxasncp_dict_t *d;
diff --git a/text2pcap-scanner.l b/text2pcap-scanner.l
index d1871cdfdd..be68b1b71b 100644
--- a/text2pcap-scanner.l
+++ b/text2pcap-scanner.l
@@ -15,6 +15,11 @@
*/
%option never-interactive
+/*
+ * We want to stop processing when we get to the end of the input.
+ */
+%option noyywrap
+
%{
/********************************************************************************
@@ -88,10 +93,3 @@ eol \r?\n\r?
{directive} { parse_token(T_DIRECTIVE, yytext); }
{comment} ; /* ignore comments */
{text} { parse_token(T_TEXT, yytext); }
-
-%%
-
-int yywrap(void)
-{
- return 1;
-}
diff --git a/tools/lemon/lemonflex-tail.inc b/tools/lemon/lemonflex-tail.inc
index 55af823ac9..5a63fdd3f6 100644
--- a/tools/lemon/lemonflex-tail.inc
+++ b/tools/lemon/lemonflex-tail.inc
@@ -9,7 +9,9 @@ Prototypes:
void CONCAT(MODNAME,_scanner_text(char *text));
void CONCAT(MODNAME,_scanner_file(FILE *fh));
void CONCAT(MODNAME,_scanner_cleanup(void));
+#ifndef YY_SKIP_YYWRAP
int CONCAT(MODNAME,_wrap(void));
+#endif
#include <cppmagic.h>
diff --git a/ui/text_import_scanner.l b/ui/text_import_scanner.l
index 625cc050d1..23e6d24adb 100644
--- a/ui/text_import_scanner.l
+++ b/ui/text_import_scanner.l
@@ -11,6 +11,11 @@
%option never-interactive
/*
+ * We want to stop processing when we get to the end of the input.
+ */
+%option noyywrap
+
+/*
* Prefix scanner routines with "text_import" rather than "yy", so this scanner
* can coexist with other scanners.
*/
@@ -92,9 +97,3 @@ eol \r?\n\r?
{text} { parse_token(T_TEXT, yytext); }
<<EOF>> { write_current_packet(); yyterminate(); }
-
-%%
-int yywrap(void)
-{
- return 1;
-}
diff --git a/wiretap/ascend_scanner.l b/wiretap/ascend_scanner.l
index ff8b0a1ec8..b7df4cb76a 100644
--- a/wiretap/ascend_scanner.l
+++ b/wiretap/ascend_scanner.l
@@ -4,6 +4,11 @@
%option never-interactive
/*
+ * We want to stop processing when we get to the end of the input.
+ */
+%option noyywrap
+
+/*
* Prefix scanner routines with "ascend" rather than "yy", so this scanner
* can coexist with other scanners.
*/
@@ -339,14 +344,3 @@ void ascend_init_lexer(FILE_T fh)
yy_fh = fh;
BEGIN(INITIAL);
}
-
-/*
- * We want to stop processing when we get to the end of the input.
- * (%option noyywrap is not used because if used then
- * some flex versions (eg: 2.5.35) generate code which causes
- * warnings by the Windows VC compiler).
- */
-
-int yywrap(void) {
- return 1;
-}
diff --git a/wiretap/k12text.l b/wiretap/k12text.l
index 350393538a..7601b94232 100644
--- a/wiretap/k12text.l
+++ b/wiretap/k12text.l
@@ -14,6 +14,11 @@
%option never-interactive
/*
+ * We want to stop processing when we get to the end of the input.
+ */
+%option noyywrap
+
+/*
* Prefix scanner routines with "K12Text_" rather than "yy", so this scanner
* can coexist with other scanners.
*/
@@ -461,14 +466,3 @@ k12text_dump_can_write_encap(int encap)
return WTAP_ERR_UNWRITABLE_ENCAP;
}
}
-
-/*
- * We want to stop processing when we get to the end of the input.
- * (%option noyywrap is not used because if used then
- * some flex versions (eg: 2.5.35) generate code which causes
- * warnings by the Windows VC compiler).
- */
-
-int yywrap(void) {
- return 1;
-}