autoconf/tests
Zack Weinberg 87a81f44c6
Fix testsuite failures from ‘make maintainer-check-c++’.
‘make maintainer-check-c++’ has two test failures that don’t show in
an ordinary ‘make check’.  One of these is a pair of problems with the
semantics.at test of AC_CHECK_DECL(S):

 * AC_CHECK_DECL cannot handle a function argument whose declared type
   is ‘char []’; it generates a cast to the array type, which is
   invalid in both C and C++.  This was masked by an M4 quotation bug,
   causing it to emit a cast to ‘char’ instead, prodicing code that
   was valid C but invalid C++.  I don’t think it’s practical to teach
   AC_CHECK_DECL to do argument type decay, so I changed the type
   signature in the AC_CHECK_DECL call (not in the actual declaration)
   to ‘char *’.  Conveniently this also avoids the quotation issue.

 * In C++, apparently ‘extern struct { int x; } foo;’ is invalid.
   (clang++ explains at length: “variable ‘foo’ is used but not
   defined in this translation unit, and cannot be defined in any
   other translation unit because its type does not have linkage.”)
   Fixed by giving the struct a tag.

The other failure is an actual bug in AC_PROG_LEX: the test program
used by _AC_PROG_LEX_YYTEXT_DECL uses the flex utility function
‘input’, which is renamed to ‘yyinput’ when the scanner is compiled as
C++.  Fixed with ifdefs in the offending action--it might seem cleaner
to use a macro defined in a %{ %} block, but that would be inserted into
the skeleton *above* the declaration of (yy)input, so I didn’t feel
it was safe.

* tests/semantics.at (AC_CHECK_DECLS): Adjust test programs for C++
  compatibility and to work around lack of support for argument type
  decay.

* programs.m4 (_AC_PROG_LEX_YYTEXT_DECL): Call yyinput(), not input(),
  in scanner action when scanner is compiled as C++.
2020-08-28 16:42:28 -04:00
..
atlocal.in Look harder for a shell whose -n is known to work. 2020-06-29 23:17:15 -07:00
autoscan.at maint: make update-copyright 2020-01-01 11:45:50 -08:00
autotest.at tests: New helper macro AT_CHECK_MAKE. 2020-08-20 14:07:59 -04:00
base.at AS_INIT: ensure fds 0, 1, 2 are open 2020-08-28 11:19:16 -04:00
c.at tests: New helper macro AT_CHECK_MAKE. 2020-08-20 14:07:59 -04:00
compile.at Warn if AC_INIT or AC_OUTPUT are missing from configure.ac (#107986) 2020-08-18 08:24:05 -04:00
erlang.at maint: make update-copyright 2020-01-01 11:45:50 -08:00
foreign.at tests: New helper macro AT_CHECK_MAKE. 2020-08-20 14:07:59 -04:00
fortran.at tests: New helper macro AT_CHECK_MAKE. 2020-08-20 14:07:59 -04:00
go.at maint: make update-copyright 2020-01-01 11:45:50 -08:00
local.at Add ‘START_TIME’ and ‘ToD’ to shell variable filter list. 2020-08-26 15:15:34 -04:00
local.mk Pass $(MAKE) down to testsuite. 2020-08-26 15:12:12 -04:00
m4sh.at Warn if AC_INIT or AC_OUTPUT are missing from configure.ac (#107986) 2020-08-18 08:24:05 -04:00
m4sugar.at maint: make update-copyright 2020-01-01 11:45:50 -08:00
mktests.sh Don’t distribute tests/ac*.at. 2020-08-18 14:54:24 -04:00
semantics.at Fix testsuite failures from ‘make maintainer-check-c++’. 2020-08-28 16:42:28 -04:00
statesave.m4 maint: make update-copyright 2020-01-01 11:45:50 -08:00
suite.at tests/suite.at: m4_include acerlang.at. 2020-08-20 08:51:46 -04:00
tools.at Warn if AC_INIT or AC_OUTPUT are missing from configure.ac (#107986) 2020-08-18 08:24:05 -04:00
torture.at AS_INIT: ensure fds 0, 1, 2 are open 2020-08-28 11:19:16 -04:00
wrapper.as Warn if AC_INIT or AC_OUTPUT are missing from configure.ac (#107986) 2020-08-18 08:24:05 -04:00