From 0522fbc888432a74d62bf268b0d3ecc0dc25f5d2 Mon Sep 17 00:00:00 2001 From: TimePath Date: Tue, 15 Mar 2016 20:23:25 +1100 Subject: [PATCH] qcc.sh: fix preprocessor error reporting --- qcsrc/tools/qcc.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qcsrc/tools/qcc.sh b/qcsrc/tools/qcc.sh index 92f8b98fb..40223c113 100755 --- a/qcsrc/tools/qcc.sh +++ b/qcsrc/tools/qcc.sh @@ -1,5 +1,6 @@ #!/bin/bash -set -eu +set -euo pipefail +IFS=$' \n\t' WORKDIR=${WORKDIR} CPP=${CPP} @@ -12,6 +13,7 @@ function qpp() { IN=$1 OUT=$2 >&2 echo + ${CPP} ${@:3} ${IN} + set +e # additional information ${CPP} ${@:3} \ -dM 1>${WORKDIR}/${MODE}_macros.txt \ @@ -19,6 +21,9 @@ function qpp() { ${IN} # main step ${CPP} ${@:3} -MMD -MP -MT ${OUT} -Wall -Wundef -Werror ${IN} -o ${WORKDIR}/${MODE}.txt + err=$? + set -e + if [ ${err} -ne 0 ]; then return ${err}; fi sed 's/^#\(line\)\? \([[:digit:]]\+\) "\(.*\)".*/\n#pragma file(\3)\n#pragma line(\2)/g' ${WORKDIR}/${MODE}.txt } -- 2.39.2