summary refs log tree commit diff
diff options
context:
space:
mode:
authorEugene Sharygin <eush@ispras.ru>2017-10-06 19:34:50 +0300
committerQuentin Carbonneaux <quentin@c9x.me>2017-10-07 21:19:18 +0200
commit39b1f468b09d94cac6ec65a8c0fbc210e3c9989e (patch)
tree56c0b9ed7e7be98f33237ba7e77199471062617c
parente54f7a0fda867f4cc7ae42bfaa6e38ad26034f7f (diff)
downloadroux-39b1f468b09d94cac6ec65a8c0fbc210e3c9989e.tar.gz
fix compiler command in testcc
This commit adds missing quotation marks around the argument to the
function, and changes the value of `-x' option to `c` (lowercase) as per
GCC manual [1].

[1]: https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/Overall-Options.html
-rwxr-xr-xtools/test.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/test.sh b/tools/test.sh
index 6e55447..8abdb21 100755
--- a/tools/test.sh
+++ b/tools/test.sh
@@ -11,7 +11,7 @@ exe=$tmp.exe
 out=$tmp.out
 
 testcc() {
-	echo "int main() { }" | $1 -x C -o /dev/null - >/dev/null 2>&1
+	echo "int main() { }" | $1 -x c -o /dev/null - >/dev/null 2>&1
 	return $?
 }
 
@@ -51,7 +51,7 @@ init() {
 			;;
 		*)
 			cc="cc -no-pie"
-			testcc $cc || cc="cc"
+			testcc "$cc" || cc="cc"
 			;;
 		esac
 		;;