C++ syntax validator
Kevin Adrian

Hi,

can anybody give a suggestion for a C++ syntax checking/validation tool? In my job we are using a scripting language with a C++ syntax. I've already searched for such tool but Google just found code analysing tools regarding to performance and code quality measurement. I just want to test, if there are any syntax errors in my source code. The syntax checking of the scripting language we are using at work has a very poor and not reliable error reporting.

By the way, an open source tool would be awesome :-)

Thanks in advance!

Erin Maus

Clang and GCC have an option, -fsyntax-only, to only check for syntax errors. Assuming the language is a strict subset of C or C++, that should work.

Kevin Adrian

OK thanks! I'll try that.

Chris Katko

Also, the term you're looking for is a Linter. A tool that merely checks the code validity.

One of the most popular C++ linters is called CppCheck and it's a huge, well-supported, project.

http://cppcheck.sourceforge.net/

Thread #616838. Printed from Allegro.cc