[git commit] buildsys: add cppcheck wrapper script

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Wed Jan 18 07:44:39 UTC 2012


commit: http://git.uclibc.org/uClibc/commit/?id=9617bbc95b468b019814a6e25178d53bb4bb8783
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
 extra/scripts/cppcheck.sh |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/extra/scripts/cppcheck.sh b/extra/scripts/cppcheck.sh
new file mode 100755
index 0000000..7484e09
--- /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


More information about the uClibc-cvs mailing list