at commit afb1ecfe

1 #!/bin/sh -eu
2 # SPDX-License-Identifier: GPL-2.0
3
4 [ ! -x "$(command -v "$1")" ] && exit 1
5
6 tmp_file=$(mktemp)
7 trap "rm -f $tmp_file" EXIT
8
9 cat << EOF >$tmp_file
10 static inline int u(const int *q)
11 {
12 __typeof_unqual__(*q) v = *q;
13 return v;
14 }
15 EOF
16
17 # sparse happily exits with 0 on error so validate
18 # there is none on stderr. Use awk as grep is a pain with sh -e
19 $@ $tmp_file 2>&1 | awk -v c=1 '/error/{c=0}END{print c}'