diff options
author | Adam Novak <anovak@soe.ucsc.edu> | 2018-06-01 13:35:24 -0700 |
---|---|---|
committer | Adam Novak <anovak@soe.ucsc.edu> | 2018-06-01 13:38:03 -0700 |
commit | 14b54b7d94f437b1fd53418c9819c1a1616a3616 (patch) | |
tree | ae6e45888d9883eab0ece8dea5a2da2a69123e76 /scripts | |
parent | eb61e5a2247af04c581a52b38bbec0b822171fbe (diff) | |
download | raptor-14b54b7d94f437b1fd53418c9819c1a1616a3616.tar.gz |
Update to work with Bison 3.0.5
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/fix-bison.pl | 8 | ||||
-rwxr-xr-x | scripts/install-bison3.sh | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/scripts/fix-bison.pl b/scripts/fix-bison.pl index 38f45e81..b5b3e748 100755 --- a/scripts/fix-bison.pl +++ b/scripts/fix-bison.pl @@ -12,6 +12,7 @@ # my $seen_yyerrlab1=0; +my $syntax_error_has_default=0; my $line_offset=1; # #line directives always refer to the NEXT line while(<>) { # Remove code that causes a warning @@ -42,8 +43,11 @@ while(<>) { next; } - if(m%^\# undef YYCASE_$%) { - # Add a default value for yyformat for coverity CID 10838 + # syntax error handler will have a default case already in Bison 3.0.5+ + $syntax_error_has_default=1 if /default: \/\* Avoid compiler warnings. \*\//; + + if(m%^\# undef YYCASE_$% and $syntax_error_has_default==0) { + # Add a default value for yyformat on Bison <3.0.5, for coverity CID 10838 my $line=$_; print qq{ default: yyformat = YY_("syntax error");\n}; $line_offset++; # extra line diff --git a/scripts/install-bison3.sh b/scripts/install-bison3.sh index 52fa0ed1..3f2f133a 100755 --- a/scripts/install-bison3.sh +++ b/scripts/install-bison3.sh @@ -5,7 +5,7 @@ set -x PACKAGE=bison MIN_VERSION=3.0.0 -INSTALL_VERSION=3.0.2 +INSTALL_VERSION=3.0.5 # Bison requires that CC is a C compiler CC=cc |