Skip to content

Commit

Permalink
Verbose messages from newer compilers confuse conf.sh
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
citrus-it committed Jan 12, 2021
1 parent 6a8e211 commit 061a4b1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/libast/comp/conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 061a4b1

Please sign in to comment.