scan-build.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/sh
  2. # Copyright 2014 The Tor Project, Inc
  3. # See LICENSE for licensing information
  4. #
  5. # This script is used for running a bunch of clang scan-build checkers
  6. # on Tor.
  7. CHECKERS="\
  8. -disable-checker deadcode.DeadStores \
  9. -enable-checker alpha.core.CastSize \
  10. -enable-checker alpha.core.CastToStruct \
  11. -enable-checker alpha.core.IdenticalExpr \
  12. -enable-checker alpha.core.SizeofPtr \
  13. -enable-checker alpha.security.ArrayBoundV2 \
  14. -enable-checker alpha.security.MallocOverflow \
  15. -enable-checker alpha.security.ReturnPtrRange \
  16. -enable-checker alpha.unix.SimpleStream
  17. -enable-checker alpha.unix.cstring.BufferOverlap \
  18. -enable-checker alpha.unix.cstring.NotNullTerminated \
  19. -enable-checker alpha.unix.cstring.OutOfBounds \
  20. -enable-checker alpha.core.FixedAddr \
  21. -enable-checker security.insecureAPI.strcpy \
  22. -enable-checker alpha.unix.PthreadLock \
  23. -enable-checker alpha.core.PointerArithm \
  24. -enable-checker alpha.core.TestAfterDivZero \
  25. "
  26. scan-build \
  27. $CHECKERS \
  28. ./configure
  29. scan-build \
  30. $CHECKERS \
  31. make -j2 -k
  32. # This one gives a false positive on every strcmp.
  33. # -enable-checker alpha.core.PointerSub
  34. # Needs work
  35. # alpha.unix.MallocWithAnnotations ??