From: Akim Demaille Date: Fri, 26 Oct 2012 14:33:20 +0000 (+0200) Subject: Merge branch 'branch-2.6' into maint X-Git-Tag: v2.6.90~50 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/71cb558dfe0f9c80e697308a5084de3b9926ee9c?hp=-c Merge branch 'branch-2.6' into maint * origin/branch-2.6: regen yacc.c: do not define location support when not using locations maint: be compilable with GCC 4.0 tests: address a warning from GCC 4.4 tests: don't use options that Clang does not support tests: restore the tests on -Werror regen parse-gram: update the Bison interface fix comment --- 71cb558dfe0f9c80e697308a5084de3b9926ee9c diff --combined configure.ac index 6a0e9c45,651fa139..955f56ef --- a/configure.ac +++ b/configure.ac @@@ -72,6 -72,18 +72,18 @@@ if test "$enable_gcc_warnings" = yes; t -Wshadow -Wstrict-prototypes' warn_cxx='-Wnoexcept' AC_LANG_PUSH([C]) + # Clang supports many of GCC's -W options, but only issues warnings + # on the ones it does not recognize. In that case, gl_WARN_ADD + # thinks the option is supported, and unknown options are then added + # to CFLAGS. But then, when -Werror is added in the test suite for + # instance, the warning about the unknown option turns into an + # error. + # + # This should be addressed by gnulib's gl_WARN_ADD, but in the + # meanwhile, turn warnings about unknown options into errors in + # CFLAGS, and restore CFLAGS after the tests. + save_CFLAGS=$CFLAGS + gl_WARN_ADD([-Werror=unknown-warning-option], [CFLAGS]) for i in $warn_common $warn_c; do gl_WARN_ADD([$i], [WARN_CFLAGS]) @@@ -80,19 -92,23 +92,23 @@@ # Warnings for the test suite only. gl_WARN_ADD([-Wundef], [WARN_CFLAGS_TEST]) gl_WARN_ADD([-pedantic], [WARN_CFLAGS_TEST]) + CFLAGS=$save_CFLAGS AC_LANG_POP([C]) AC_LANG_PUSH([C++]) + save_CXXFLAGS=$CXXFLAGS + gl_WARN_ADD([-Werror=unknown-warning-option], [CXXFLAGS]) for i in $warn_common $warn_cxx; do gl_WARN_ADD([$i], [WARN_CXXFLAGS]) done - gl_WARN_ADD([ -Wzero-as-null-pointer-constant], [WARN_CXXFLAGS], + gl_WARN_ADD([-Wzero-as-null-pointer-constant], [WARN_CXXFLAGS], [AC_LANG_PROGRAM([], [nullptr])]) gl_WARN_ADD([-Werror], [WERROR_CXXFLAGS]) # Warnings for the test suite only. gl_WARN_ADD([-Wundef], [WARN_CXXFLAGS_TEST]) gl_WARN_ADD([-pedantic], [WARN_CXXFLAGS_TEST]) + CXXFLAGS=$save_CXXFLAGS AC_LANG_POP([C++]) fi @@@ -115,7 -131,6 +131,7 @@@ AC_SUBST([YACC_SCRIPT] AC_SUBST([YACC_LIBRARY]) # Checks for programs. +AM_MISSING_PROG([DOT], [dot]) AC_PROG_LEX $LEX_IS_FLEX || AC_MSG_ERROR([Flex is required]) AC_PROG_YACC diff --combined src/getargs.c index 56d9724d,64905694..226e6de0 --- a/src/getargs.c +++ b/src/getargs.c @@@ -49,7 -49,7 +49,7 @@@ #include "quote.h" #include "uniqstr.h" - bool debug_flag; + bool debug; bool defines_flag; bool graph_flag; bool xml_flag; @@@ -343,14 -343,13 +343,14 @@@ Warning categories include:\n `yacc' incompatibilities with POSIX Yacc\n\ `conflicts-sr' S/R conflicts (enabled by default)\n\ `conflicts-rr' R/R conflicts (enabled by default)\n\ + `deprecated' obsolete constructs\n\ `other' all other warnings (enabled by default)\n\ `all' all the warnings\n\ `no-CATEGORY' turn off warnings in CATEGORY\n\ `none' turn off all the warnings\n\ `error' treat warnings as errors\n\ -\n\ "), stdout); + putc ('\n', stdout); fputs (_("\ THINGS is a list of comma separated words that can include:\n\ @@@ -665,7 -664,7 +665,7 @@@ getargs (int argc, char *argv[] break; case 't': - debug_flag = true; + debug = true; break; case 'v': diff --combined src/output.c index a99ef4cd,4a4d62d1..3852729b --- a/src/output.c +++ b/src/output.c @@@ -41,6 -41,8 +41,6 @@@ #include "symtab.h" #include "tables.h" -# define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array)) - static struct obstack format_obstack; @@@ -626,7 -628,7 +626,7 @@@ prepare (void use_push_for_pull_flag = true; /* Flags. */ - MUSCLE_INSERT_BOOL ("debug_flag", debug_flag); + MUSCLE_INSERT_BOOL ("debug_flag", debug); MUSCLE_INSERT_BOOL ("defines_flag", defines_flag); MUSCLE_INSERT_BOOL ("error_verbose_flag", error_verbose); MUSCLE_INSERT_BOOL ("glr_flag", glr_parser); diff --combined tests/local.at index 65ff8870,97107a55..f172b244 --- a/tests/local.at +++ b/tests/local.at @@@ -137,7 -137,7 +137,7 @@@ m4_pushdef([AT_LEXPARAM_IF] m4_pushdef([AT_LOCATION_IF], [m4_bmatch([$3], [%locations], [$1], [$2])]) m4_pushdef([AT_LOCATION_TYPE_IF], -[m4_bmatch([$3], [%define location_type], [$1], [$2])]) +[m4_bmatch([$3], [%define \(api\.location\.type\|location_type\)], [$1], [$2])]) m4_pushdef([AT_PARAM_IF], [m4_bmatch([$3], [%parse-param], [$1], [$2])]) m4_pushdef([AT_PURE_IF], @@@ -462,10 -462,14 +462,14 @@@ m4_define([AT_BISON_CHECK_WARNINGS] [m4_null_if([$2], [AT_BISON_CHECK_WARNINGS_($@)])])]) m4_define([AT_BISON_CHECK_WARNINGS_], - [[# Defining POSIXLY_CORRECT causes bison to complain if options - # are added after the grammar file name, so skip these checks - # in that case. - if test -z "${POSIXLY_CORRECT+set}"; then + [[# Defining POSIXLY_CORRECT causes bison to complain if options are + # added after the grammar file name, so skip these checks in that + # case. + # + # Don't just check if $POSIXLY_CORRECT is set, as Bash, when launched + # as /bin/sh, sets the shell variable POSIXLY_CORRECT to y, but not + # the environment variable. + if env | grep '^POSIXLY_CORRECT=' >/dev/null; then :; else ]AT_SAVE_SPECIAL_FILES[ # To avoid expanding it repeatedly, store specified stdout.