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

I don't think you can conclusively guess what language a file is even by analyzing the file contents because it is possible to compile C code with a C++ compiler. The only way to conclusively resolve this problem is to allow the user to override the bad guess and specify a language and to also specify a specific version of that language.

The problem is the user will never know when cppcheck guesses wrong so there must be some way to get cppcheck to tell you what language it thinks the code is so you know to override the bad guess.