From 061a4b1da12400cc1902dd7bdc7c3fc438bd9ff0 Mon Sep 17 00:00:00 2001 From: Andy Fiddaman Date: Sat, 9 Jan 2021 02:50:20 +0000 Subject: [PATCH] Verbose messages from newer compilers confuse conf.sh conf.sh checks for undefined symbols by parsing compiler output and looking for strings of capital letters and underscores. Modern gcc produces suggestions for replacement variables too, for example: error: '_SC_CLOCKRES_MIN' undeclared here (not in a function); did you mean _POSIX_CLOCKRES_MIN? _SC_CLOCKRES_MIN, ^~~~~~~~~~~~~~~~ _POSIX_CLOCKRES_MIN This causes good variables to be excluded along with bad, causing differences between the builtin and system getconf commands. --- src/lib/libast/comp/conf.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/libast/comp/conf.sh b/src/lib/libast/comp/conf.sh index 7e67554273ee..795d0026e0ba 100644 --- a/src/lib/libast/comp/conf.sh +++ b/src/lib/libast/comp/conf.sh @@ -817,7 +817,8 @@ unsigned int conf[] = { [ -f $tmp.1.e ] || cp $tmp.e $tmp.1.e snl='\ ' - sed "s/[^_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789][^_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789]*/${snl}/g" $tmp.e | + grep 'error:' $tmp.e | sed "s/did you mean.*//" | + sed "s/[^_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789][^_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789]*/${snl}/g" | grep '^[_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz][_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789]*$' | sort -u > $tmp.n cmp -s $tmp.n $tmp.p && break