Elijah Newren | 85e4f76 | 2025-03-19 16:22:57 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | make CHECK_ASSERTION_SIDE_EFFECTS=1 >compiler_output 2>compiler_error |
| 4 | if test $? != 0 |
| 5 | then |
| 6 | echo >&2 "ERROR: The compiler could not verify the following assert()" |
| 7 | echo >&2 " calls are free of side-effects. Please replace with" |
| 8 | echo >&2 " ASSERT() calls." |
| 9 | grep undefined.reference.to..not_supposed_to_survive compiler_error | |
| 10 | sed -e s/:[^:]*$// | sort | uniq | tr ':' ' ' | |
| 11 | while read f l |
| 12 | do |
| 13 | printf "${f}:${l}\n " |
| 14 | awk -v start="$l" 'NR >= start { print; if (/\);/) exit }' $f |
| 15 | done |
| 16 | exit 1 |
| 17 | fi |
| 18 | rm compiler_output compiler_error |