summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2012-01-18 08:44:39 +0100
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2012-01-18 08:44:39 +0100
commit9617bbc95b468b019814a6e25178d53bb4bb8783 (patch)
tree250c58e2e7983502a7d803c7709ab57d83093400
parentde5964178b62d4c98d43307f7d2ee5b6e0729483 (diff)
buildsys: add cppcheck wrapper script
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-rwxr-xr-xextra/scripts/cppcheck.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/extra/scripts/cppcheck.sh b/extra/scripts/cppcheck.sh
new file mode 100755
index 000000000..7484e09bf
--- /dev/null
+++ b/extra/scripts/cppcheck.sh
@@ -0,0 +1,23 @@
+#! /bin/sh
+
+${REAL_CC-gcc} $*
+
+args=""
+add_next=0
+
+for i in $*
+do
+ if [ $add_next -eq 1 ] ; then
+ [ "x$args" = "x" ] && args="$i" || args="$args $i"
+ add_next=0
+ continue
+ fi
+ case "/$i" in
+ /-c) add_next=1 ;;
+ /-D*|/-I*|/-inc) [ "x$args" = "x" ] && args="$i" || args="$args $i" ;;
+ /-dumpversion|/--print*) ${CC-gcc} $i ; exit 0 ;;
+ *) ;;
+ esac
+done
+
+cppcheck $args