diff options
author | Noah Misch <noah@cs.caltech.edu> | 2018-11-24 20:57:43 -0800 |
---|---|---|
committer | Noah Misch <noah@cs.caltech.edu> | 2018-11-24 20:57:43 -0800 |
commit | 92851e84f76f9cf67e0f299cb20380da74b7dca7 (patch) | |
tree | 6aa8d8d2db63d43efc206a2e90a0d9223b6647c2 | |
parent | 487d6aaaa4fe45001d30c439ea6240fc74f1b5d7 (diff) | |
download | autoconf-92851e84f76f9cf67e0f299cb20380da74b7dca7.tar.gz |
AC_CHECK_DECL: when cached, don't overwrite a werror flag
* lib/autoconf/general.m4 (_AC_CHECK_DECL_BODY): Restore werror flags
inside the AC_CACHE_CHECK that saves them. Commit
82ef7805faffa151e724aa76c245ec590d174580 broke this. From Tom Lane
(trivial change).
* tests/semantics.at (AC_CHECK_DECLS): Test this.
-rw-r--r-- | lib/autoconf/general.m4 | 4 | ||||
-rw-r--r-- | tests/semantics.at | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 58f7a64c..e1d82b54 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -2962,8 +2962,8 @@ m4_define([_AC_CHECK_DECL_BODY], @%:@endif ])], [AS_VAR_SET([$[]3], [yes])], - [AS_VAR_SET([$[]3], [no])])]) - ac_[]_AC_LANG_ABBREV[]_werror_flag=$ac_save_werror_flag + [AS_VAR_SET([$[]3], [no])]) + ac_[]_AC_LANG_ABBREV[]_werror_flag=$ac_save_werror_flag]) AS_LINENO_POP ])# _AC_CHECK_DECL_BODY diff --git a/tests/semantics.at b/tests/semantics.at index ec44af3a..49b89234 100644 --- a/tests/semantics.at +++ b/tests/semantics.at @@ -139,7 +139,11 @@ AT_CHECK_MACRO([AC_CHECK_DECLS], extern char *declared (const char *); #endif ]]) + AC_LANG_WERROR AC_CHECK_DECL([undeclared (char *)], [AS_EXIT([1])],, [[]]) + if test -z "$ac_c_werror_flag"; then + AC_MSG_ERROR([ac_c_werror_flag overwritten]) + fi ]], [AT_CHECK_DEFINES( [#define HAVE_DECL_BASENAM 1 |