Skip to content

Commit 3691077

Browse files
committed
silence compiler warnings
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
1 parent db836ba commit 3691077

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

testme.sh

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,29 @@ _die()
105105
fi
106106
}
107107

108+
_fixup_cflags() {
109+
compiler_version=$(echo "$1="$($1 -dumpversion))
110+
case "$compiler_version" in
111+
clang*=4.2.1)
112+
# one of my versions of clang complains about some stuff in stdio.h and stdarg.h ...
113+
TEST_CFLAGS="-Wno-typedef-redefinition"
114+
;;
115+
gcc*=9)
116+
# gcc 9 seems to sometimes think that variables are uninitialized, but they are.
117+
TEST_CFLAGS="-Wno-maybe-uninitialized"
118+
;;
119+
*)
120+
TEST_CFLAGS=""
121+
;;
122+
esac
123+
echo $compiler_version
124+
}
125+
108126
_make()
109127
{
110128
echo -ne " Compile $1 $2"
111129
suffix=$(echo ${1}${2} | tr ' ' '_')
130+
_fixup_cflags "$1"
112131
CC="$1" CFLAGS="$2 $TEST_CFLAGS" make -j$MAKE_JOBS $3 $MAKE_OPTIONS 2>gcc_errors_${suffix}.log
113132
errcnt=$(wc -l < gcc_errors_${suffix}.log)
114133
if [[ ${errcnt} -gt 1 ]]; then
@@ -400,15 +419,6 @@ do
400419
echo "Skipped compiler $i, file not found"
401420
continue
402421
fi
403-
compiler_version=$(echo "$i="$($i -dumpversion))
404-
if [ "$compiler_version" == "clang=4.2.1" ]
405-
then
406-
# one of my versions of clang complains about some stuff in stdio.h and stdarg.h ...
407-
TEST_CFLAGS="-Wno-typedef-redefinition"
408-
else
409-
TEST_CFLAGS=""
410-
fi
411-
echo $compiler_version
412422

413423
for a in "${archflags[@]}"
414424
do

0 commit comments

Comments
 (0)