]> granicus.if.org Git - postgresql/commitdiff
Silence Bison deprecation warnings
authorJoe Conway <mail@joeconway.com>
Mon, 2 Jan 2017 21:51:10 +0000 (13:51 -0800)
committerJoe Conway <mail@joeconway.com>
Mon, 2 Jan 2017 21:51:10 +0000 (13:51 -0800)
Bison >=3.0 issues warnings about

    %name-prefix="base_yy"

instead of the now preferred

    %name-prefix "base_yy"

but the latter doesn't work with Bison 2.3 or less.  So for now we
silence the deprecation warnings.

Back-patch to 9.2 and 9.3 -- the newer branches already have this fix.

Author: Peter Eisentraut
Discussion: https://postgr.es/m/677.1483384145%40sss.pgh.pa.us

config/programs.m4
configure

index c9f0740800a20d2b8070149155c4b9770d927413..eb763b03a8518962c8ecb348aa208d92f9890321 100644 (file)
@@ -23,6 +23,14 @@ if test "$BISON"; then
 *** Bison version 1.875 or later is required, but this is $pgac_bison_version.])
     BISON=""
   fi
+  # Bison >=3.0 issues warnings about %name-prefix="base_yy", instead
+  # of the now preferred %name-prefix "base_yy", but the latter
+  # doesn't work with Bison 2.3 or less.  So for now we silence the
+  # deprecation warnings.
+  if echo "$pgac_bison_version" | $AWK '{ if ([$]4 >= 3) exit 0; else exit 1;}'
+  then
+    BISONFLAGS="$BISONFLAGS -Wno-deprecated"
+  fi
 fi
 
 if test -z "$BISON"; then
index 2154ee19cbcd418318d848ee0410dc24d6af7f87..2e5359d79fee914b5ec5b52f184a578199bee8d8 100755 (executable)
--- a/configure
+++ b/configure
@@ -7121,6 +7121,14 @@ $as_echo "$as_me: WARNING:
 *** Bison version 1.875 or later is required, but this is $pgac_bison_version." >&2;}
     BISON=""
   fi
+  # Bison >=3.0 issues warnings about %name-prefix="base_yy", instead
+  # of the now preferred %name-prefix "base_yy", but the latter
+  # doesn't work with Bison 2.3 or less.  So for now we silence the
+  # deprecation warnings.
+  if echo "$pgac_bison_version" | $AWK '{ if ($4 >= 3) exit 0; else exit 1;}'
+  then
+    BISONFLAGS="$BISONFLAGS -Wno-deprecated"
+  fi
 fi
 
 if test -z "$BISON"; then