hi Denis, > Le 18 avr. 2020 à 15:22, Denis Excoffier <[email protected]> a > écrit : > > Hello, > > For compilation it’s ok except for make check, because you may not know > that under Darwin, wc has a few spaces in front of the result, e.g. > > % (echo 1; echo 2; echo 3) | wc -l > 3 > % > > compared to GNU coreutils: > % (echo 1; echo 2; echo 3) | wc -l > 3 > %
Bummer... I thought we had taken care of that. Thanks a lot for testing the beta, and for reporting this, I'll install the patch below. Cheers! commit 1d0e3ee896dd5c973138c369ae1ed73924908d18 Author: Akim Demaille <[email protected]> Date: Sun Apr 19 08:05:35 2020 +0200 tests: beware of portability issues with wc On macOS, wc -l always prepends the result with a tab, even when fed by stdin. But anyway, we should have used `grep -c -v`, which appears to be portable according to Autoconf's "Limitations of Usual Tools" section. Reported by Denis Excoffier. https://lists.gnu.org/r/bug-bison/2020-04/msg00009.html * tests/calc.at (_AT_CHECK_CALC): Use grep's -c instead. diff --git a/tests/calc.at b/tests/calc.at index 95a6e5e7..992b911c 100644 --- a/tests/calc.at +++ b/tests/calc.at @@ -763,8 +763,8 @@ AT_JAVA_IF( [AT_PARSER_CHECK([calc input], 0, [AT_PARAM_IF([m4_n([$3])])], [stderr])]) AT_LANG_MATCH([c\|c++\|java], [AT_GLR_IF([], - [AT_CHECK([grep -v 'Return for a new token:' stderr | wc -l], - [0], + [AT_CHECK([grep -c -v 'Return for a new token:' stderr], + [ignore], [m4_n([AT_DEBUG_IF([$4], [0])])])])]) ]) diff --git a/tests/local.at b/tests/local.at index 33a8afa8..97ff0e8b 100644 --- a/tests/local.at +++ b/tests/local.at @@ -1601,7 +1601,7 @@ $9 # (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic # will issue an error. # -# There is no "" around `wc` since some indent the result. +# There is no "" around `wc` since some wc indent the result. m4_bmatch([$4], [%define lr.type canonical-lr], [if test 32767 -lt `wc -l < input.c`; then CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic / /'`
