Static analysis with autoconf

Static analysis is one way to root out more complex bugs in C and C++ programs. And clang offers a static code analyzer. To make use of it as an analyze target in an autoconfed project, just add this snippet to your

Put the filenames you want analyzed on the analyze_srcs line. If you have any local include dirs, just add them as -I flags to the clang lines.

# Static analysis.
analyze_srcs = protobuf-c-text/generate.c protobuf-c-text/parse.c
.PHONY: analyze
analyze: all
        @for f in $(analyze_srcs); do \
          if test "@AM_V@" = 1; then \
            echo clang --analyze -x c -I build-aux $$f -o /dev/null; \
          else \
            echo "  CCSA  " $$f; \
          fi; \
          clang --analyze -x c -I build-aux $$f -o /dev/null; \