1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-13 11:42:21 +00:00

getconf detection: fix compiler error msg extraction (re: 3aa01a95)

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.
This commit is contained in:
Martijn Dekker 2021-01-16 14:43:22 +00:00
parent 2f7918deec
commit 2e839d8775

View file

@ -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