diff options
-rwxr-xr-x | 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 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 |