- Add a patch to remove obsolete bison constructs YYLEX_PARAM and
  YYPARSE_PARAM. Use %lex-param, %parse-param, or %param.
This commit is contained in:
Patsy Franklin 2014-04-16 15:01:50 -04:00
parent a3088c99e8
commit 21e70cdb9f
2 changed files with 88 additions and 1 deletions

View File

@ -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 <srivasta@golden-gryphon.com>
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 <srivasta@golden-gryphon.com>
---
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 <stdio.h>
#include <stdlib.h>
@@ -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

View File

@ -1,7 +1,7 @@
Summary: A tool for creating scanners (text pattern recognizers) Summary: A tool for creating scanners (text pattern recognizers)
Name: flex Name: flex
Version: 2.5.37 Version: 2.5.37
Release: 4%{?dist} Release: 5%{?dist}
# parse.c and parse.h are under GPLv3+ with exception which allows # parse.c and parse.h are under GPLv3+ with exception which allows
# relicensing. Since flex is shipped under BDS-style license, # relicensing. Since flex is shipped under BDS-style license,
# let's assume that the relicensing was done. # 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 # https://bugzilla.redhat.com/show_bug.cgi?id=993447
Patch2: flex-2.5.37-types.patch 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) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: m4 Requires: m4
BuildRequires: gettext bison m4 BuildRequires: gettext bison m4
@ -68,6 +71,7 @@ plain text and PDF formats.
%patch0 -p1 %patch0 -p1
%patch1 -p1 %patch1 -p1
%patch2 -p1 %patch2 -p1
%patch3 -p1
%global flexdocdir %{_datadir}/doc/flex-doc-%{version} %global flexdocdir %{_datadir}/doc/flex-doc-%{version}
@ -128,6 +132,10 @@ rm -rf ${RPM_BUILD_ROOT}
%{_datadir}/doc/flex-doc-%{version} %{_datadir}/doc/flex-doc-%{version}
%changelog %changelog
* Wed Apr 16 2014 Patsy Franklin <pfrankli@redhat.com> - 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 <pmachata@redhat.com> - 2.5.37-4 * Tue Sep 3 2013 Petr Machata <pmachata@redhat.com> - 2.5.37-4
- Add a patch for "comparison between signed and unsigned" warnings - Add a patch for "comparison between signed and unsigned" warnings
that GCC produces when compiling flex-generated scanners that GCC produces when compiling flex-generated scanners