danmar/cppcheck — comment on commit aa74761e8df79053c786795828b6977fd1ed1204
File:  line 0
By rpavlik:

One thing that can be done is to look at include lines in .h files: if they include STL headers, they are c++ - this is a technique used by ohcount https://github.com/blackducksw/ohcount/blob/master/src/hash/cppheaders.gperf

Also perhaps look for "class" keyword?

If there is `extern "C"` anywhere in it, then it's c++. If there's #ifdef __cplusplus, then it should be both c and c++ (perhaps check as C++ to be more strict?)

I'd almost rather default to C++ rather than C code. If you're going to add a command line argument, perhaps match the style of GCC: -x lang - see http://stackoverflow.com/questions/4216247/forcing-gcc-to-compile-cpp-file-as-c