In addition to the other replies, gcc
is doing some analysis during compilation (and even during some optimization passes). So you could discard the generated code and still get all the warnings with e.g. gcc -Wall -O -c code.c -o /dev/null
Notice that you could extend GCC with your additional passes doing some additional, application specific, checks and warnings, e.g. with MELT (a high level domain specific language to extend GCC).
If you want strong static analysis and are willing to give additional annotations for that purpose consider also Frama C.