From 3996e94c390b2f6f8caa93e81bb1b9ee9aa4d1ed Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 15 Mar 2014 14:22:58 -0400 Subject: [PATCH] Fix Bison 4.0 warnings. From Verilog-Perl. --- src/bisonpre | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/bisonpre b/src/bisonpre index f75b9d409..d5f8e5b92 100755 --- a/src/bisonpre +++ b/src/bisonpre @@ -9,7 +9,7 @@ use Pod::Usage; use strict; use vars qw ($Debug $VERSION); -$VERSION = '3.318'; +$VERSION = '3.404'; our $Self; @@ -304,10 +304,12 @@ sub clean_input { foreach my $line (@linesin) { $l++; if ($line =~ /BISONPRE_VERSION/) { - ($line =~ /BISONPRE_VERSION\((\S+)\s*,\s*([^\),]+)\)\s*$/) + # 1 3 4 + ($line =~ /BISONPRE_VERSION\((\S+)\s*,\s*((\S+)\s*,)?\s*([^\),]+)\)\s*$/) or die "%Error: $filename:$l: Bad form of BISONPRE_VERSION: $line\n"; - my $ver=$1; my $cmd=$2; - if ($Self->{bison_version} >= $1) { + my $ver=$1; my $ver_max=$3; my $cmd=$4; + if ($Self->{bison_version} >= $1 + && (!$ver_max || $Self->{bison_version} <= $ver_max)) { $line = $cmd."\n"; } else { $line = "//NOP: $line";