clang-warns: use clang in path by default.
authorEmil Mikulic <emikulic@gmail.com>
Wed, 1 Jul 2020 09:41:46 +0000 (19:41 +1000)
committerEmil Mikulic <emikulic@gmail.com>
Wed, 1 Jul 2020 09:41:46 +0000 (19:41 +1000)
devel/clang-warns

index 68ad0e3..32d8ef5 100755 (executable)
@@ -1,13 +1,12 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Build with clang with all warnings.
 #
 TARGET=$(dirname $0)/../darkhttpd.c
-
-# Adjust to suit:
-LLVM=$HOME/llvm
-
-$LLVM/install/bin/clang -Weverything -O \
+if [[ -z "$CLANG" ]]; then
+  CLANG="$(which clang)"
+fi
+"$CLANG" -Weverything -O \
   -Wno-unreachable-code -Wno-padded -Wno-disabled-macro-expansion \
   -Wno-reserved-id-macro \
   -DDEBUG $TARGET