From 9617bbc95b468b019814a6e25178d53bb4bb8783 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 18 Jan 2012 08:44:39 +0100 Subject: buildsys: add cppcheck wrapper script Signed-off-by: Bernhard Reutner-Fischer --- extra/scripts/cppcheck.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 extra/scripts/cppcheck.sh (limited to 'extra') 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 -- cgit v1.2.3