summaryrefslogtreecommitdiff
path: root/extra/scripts/cppcheck.sh
blob: 7484e09bffe41005055d4025e60404352944331e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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