Skip to content

Commit

Permalink
getconf detection: fix compiler error msg extraction (re: 3aa01a9)
Browse files Browse the repository at this point in the history
That patch didn't work for non-gcc, non-clang compilers -- at least
Solaris Studio cc. It doesn't prefix error messages with "error:".
As a result, it caused the build to fail on Solaris with native cc.

src/lib/libast/comp/conf.sh:
- Use a sed formula that should catch error messages prefixed by
  "line xx:" while still removing warnings and suggestions. This
  works on at least clang, gcc, Solaris Studio cc.
  • Loading branch information
McDutchie committed Jan 16, 2021
1 parent 2f7918d commit 2e839d8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/libast/comp/conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,9 @@ unsigned int conf[] = {
[ -f $tmp.1.e ] || cp $tmp.e $tmp.1.e
snl='\
'
grep 'error:' $tmp.e | sed "s/did you mean.*//" |
# Extract failing identifiers. Try to isolate compiler errors while eliminating suggestions.
# As of 2021, known to work on: gcc, clang, Solaris Studio cc
sed -n 's/[Dd]id you mean.*//; /[Ww]arning:/ d; /[Ee]rror:/ p; /[Ll]ine [0-9][0-9]*:/ p' $tmp.e |
sed "s/[^_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789][^_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789]*/${snl}/g" |
grep '^[_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz][_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789]*$' |
sort -u > $tmp.n
Expand Down

0 comments on commit 2e839d8

Please sign in to comment.