From 21e70cdb9f2e29e08094360fa73e3fae23d86486 Mon Sep 17 00:00:00 2001 From: Patsy Franklin Date: Wed, 16 Apr 2014 15:01:50 -0400 Subject: [PATCH] Resolves: #1087433 - Add a patch to remove obsolete bison constructs YYLEX_PARAM and YYPARSE_PARAM. Use %lex-param, %parse-param, or %param. --- ...-Do-not-use-obsolete-bison-construct.patch | 79 +++++++++++++++++++ flex.spec | 10 ++- 2 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 0001-bison-test-fixes-Do-not-use-obsolete-bison-construct.patch diff --git a/0001-bison-test-fixes-Do-not-use-obsolete-bison-construct.patch b/0001-bison-test-fixes-Do-not-use-obsolete-bison-construct.patch new file mode 100644 index 0000000..eb46be3 --- /dev/null +++ b/0001-bison-test-fixes-Do-not-use-obsolete-bison-construct.patch @@ -0,0 +1,79 @@ +From 35aba3d6e3c99fcd527c677bef8efeb59963fe8a Mon Sep 17 00:00:00 2001 +Message-Id: <35aba3d6e3c99fcd527c677bef8efeb59963fe8a.1397340102.git.srivasta@golden-gryphon.com> +From: Manoj Srivastava +Date: Wed, 9 Apr 2014 00:23:07 -0700 +Subject: [PATCH 1/1] [bison-test-fixes] Do not use obsolete bison constructs in tests. + +In Bison 3.0, support for YYLEX_PARAM and YYPARSE_PARAM has been +removed (deprecated in Bison 1.875): use %lex-param, %parse-param, or +%param. This commit fixes the tests so they still work. + +Signed-off-by: Manoj Srivastava +--- + tests/test-bison-yylloc/parser.y | 4 ++-- + tests/test-bison-yylval/parser.y | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + 50.0% tests/test-bison-yylloc/ + 50.0% tests/test-bison-yylval/ + +diff --git a/tests/test-bison-yylloc/parser.y b/tests/test-bison-yylloc/parser.y +index e8f4e56..224d252 100644 +--- a/tests/test-bison-yylloc/parser.y ++++ b/tests/test-bison-yylloc/parser.y +@@ -22,6 +22,7 @@ + */ + + %parse-param { void* scanner } ++%lex-param { void* scanner } + + /* + How to compile: +@@ -34,7 +35,6 @@ + #include "config.h" + + #define YYERROR_VERBOSE 1 +-#define YYLEX_PARAM scanner + + extern int testget_lineno(void*); + +@@ -52,7 +52,7 @@ int process_text(char* s) { + + %} + +-%pure_parser ++%pure-parser + + %union { + int lineno; +diff --git a/tests/test-bison-yylval/parser.y b/tests/test-bison-yylval/parser.y +index 0ffdb89..626c5e7 100644 +--- a/tests/test-bison-yylval/parser.y ++++ b/tests/test-bison-yylval/parser.y +@@ -26,6 +26,7 @@ + bison --defines --output-file="parser.c" --name-prefix="test" parser.y + */ + %parse-param { void* scanner } ++%lex-param { void* scanner } + %{ + #include + #include +@@ -33,7 +34,6 @@ + #include "config.h" + + #define YYERROR_VERBOSE 1 +-#define YYLEX_PARAM scanner + + + /* A dummy function. A check against seg-faults in yylval->str. */ +@@ -49,7 +49,7 @@ int process_text(char* s) { + + %} + +-%pure_parser ++%pure-parser + + %union { + long unused; +-- +1.9.2 + diff --git a/flex.spec b/flex.spec index 2571020..1256908 100644 --- a/flex.spec +++ b/flex.spec @@ -1,7 +1,7 @@ Summary: A tool for creating scanners (text pattern recognizers) Name: flex Version: 2.5.37 -Release: 4%{?dist} +Release: 5%{?dist} # parse.c and parse.h are under GPLv3+ with exception which allows # relicensing. Since flex is shipped under BDS-style license, # let's assume that the relicensing was done. @@ -20,6 +20,9 @@ Patch1: flex-2.5.37-aarch64.patch # https://bugzilla.redhat.com/show_bug.cgi?id=993447 Patch2: flex-2.5.37-types.patch +#fix test-bison-yylloc and test-bison-yylval test failures +Patch3: 0001-bison-test-fixes-Do-not-use-obsolete-bison-construct.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: m4 BuildRequires: gettext bison m4 @@ -68,6 +71,7 @@ plain text and PDF formats. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 %global flexdocdir %{_datadir}/doc/flex-doc-%{version} @@ -128,6 +132,10 @@ rm -rf ${RPM_BUILD_ROOT} %{_datadir}/doc/flex-doc-%{version} %changelog +* Wed Apr 16 2014 Patsy Franklin - 2.5.37-5 +- Add a patch to remove obsolete bison constructs YYLEX_PARAM and + YYPARSE_PARAM. Use %lex-param, %parse-param, or %param. + * Tue Sep 3 2013 Petr Machata - 2.5.37-4 - Add a patch for "comparison between signed and unsigned" warnings that GCC produces when compiling flex-generated scanners