Wikipedia maintains a list of static code analysis tools for various languages (including C).

Personally, I have used both PC-Lint and Splint. The best choice depends on the type of application you have written. However no matter which tool you use, there will be a low signal to noise ratio until you properly tune the tool and your code.

PC-Lint is the most powerful Lint tool I used. If you add it to an existing project, the signal to noise ratio can be low. However, once the tool and your code are properly configured, it can be used as part of your standard build process. The last major project where I used it, we set it so that PC-Lint warnings would break the build. Licenses for PC-Lint cost $389, but it is worth the cost.

Splint is a great open-source tool. I have used it on several projects, but found that it can be difficult to configure when using a compiler with non-ANSI C extenstions (e.g. on embedded systems projects).

Valgrind is also worth considering as a dynamic analysis tool.


You specifically requested feedback on SourceMonitor. This tool provides interesting metrics on your code, but should be used as a supplement to good Lint tool as it does not provide that kind of analysis.

As stated on their home page, SourceMonitor will:

...find out how much code you have and to identify the relative complexity of your modules. For example, you can use SourceMonitor to identify the code that is most likely to contain defects and thus warrants formal review.

I used it on a recent project and found it to be easy to use (even for embedded systems code). The complexity metric is an excellent resource for developing code that will be less error-prone and easier to maintain.

SourceMonitor provides nice graphs of its output as well as well-formatted XML if you want to automate metrics collection. The only downside is that the tool only runs on Windows.

Answer from Tim Henigan on Stack Overflow
๐ŸŒ
Scitools
scitools.com
Understand: The Software Developer's Multi-Tool
Understand by SciTools is a software development tool that allows you to perform static code analysis, edit and refactor code, view dependency graphs, see useful metrics, and comply with AUTOSAR and MISRA.
Pricing
We donโ€™t like pushy salespeople, so we donโ€™t hire any. Our friendly, no-pressure team will get you a quotation, usually within the same business day.
Contact
Get in touch with us via email or phone. Find the correct distributor for your region.
Features
Understand is your comprehensive multi-tool for development insights and code analysis
๐ŸŒ
C Formatter
codebeautify.org โ€บ c-formatter-beautifier
Best C Formatter and Beautifier
C Formatter will help to format, beautify, minify, compact C code, string, text. Format, Save, Share
๐ŸŒ
Visual Studio Marketplace
marketplace.visualstudio.com โ€บ items
CodeChecker - Visual Studio Marketplace
Extension for Visual Studio Code - CodeChecker integration for Visual Studio Code
๐ŸŒ
Quora
quora.com โ€บ Which-are-the-best-code-reviewing-tools-for-reviewing-C-C++-code
Which are the best code reviewing tools for reviewing C/C++ code? - Quora
Answer (1 of 3): Hi :-) I am assuming that you are asking about static analysis tools. So, here are some static analytic tools available to check C/C++ codes. These are free open source tools for reviewing the code: * C++ Check cppcheck * Oink http://danielwilkerson.com/oink/index.html * C ...
Top answer
1 of 6
14

Wikipedia maintains a list of static code analysis tools for various languages (including C).

Personally, I have used both PC-Lint and Splint. The best choice depends on the type of application you have written. However no matter which tool you use, there will be a low signal to noise ratio until you properly tune the tool and your code.

PC-Lint is the most powerful Lint tool I used. If you add it to an existing project, the signal to noise ratio can be low. However, once the tool and your code are properly configured, it can be used as part of your standard build process. The last major project where I used it, we set it so that PC-Lint warnings would break the build. Licenses for PC-Lint cost $389, but it is worth the cost.

Splint is a great open-source tool. I have used it on several projects, but found that it can be difficult to configure when using a compiler with non-ANSI C extenstions (e.g. on embedded systems projects).

Valgrind is also worth considering as a dynamic analysis tool.


You specifically requested feedback on SourceMonitor. This tool provides interesting metrics on your code, but should be used as a supplement to good Lint tool as it does not provide that kind of analysis.

As stated on their home page, SourceMonitor will:

...find out how much code you have and to identify the relative complexity of your modules. For example, you can use SourceMonitor to identify the code that is most likely to contain defects and thus warrants formal review.

I used it on a recent project and found it to be easy to use (even for embedded systems code). The complexity metric is an excellent resource for developing code that will be less error-prone and easier to maintain.

SourceMonitor provides nice graphs of its output as well as well-formatted XML if you want to automate metrics collection. The only downside is that the tool only runs on Windows.

2 of 6
5

We use PC-Lint and are very happy with it.

There seem to be a few camps regarding message suppression and tuning:

  • suppress everything, then unsuppress only what you're interested in
  • unsuppress everything, then suppress warnings you're not interested in
  • keep everything unsuppressed

We tend to fall somewhere between the second and third categories. This does mean a ludicrous 100MiB+ text dump (one error per line) per lint run across the core libraries (lots of old code).

A custom diff-like tool watches for changes and emails those out to the commit's author, which keeps the amount that most people have to look at down to a few lines. We gather interesting statistics about errors-over-time with some basic data mining.

You can get really polished here, hyperlinking the errors back to more detailed descriptions, providing "points" for fixing existing warnings, etc...

Find elsewhere
๐ŸŒ
CodeChef
codechef.com โ€บ ide
Online Compiler & IDE for Python, C++, C, Java, Rust - CodeChef
Compile & run your code with the CodeChef online IDE. Our online compiler supports multiple programming languages like Python, C++, C, JavaScript, Rust, Go, Kotlin, and many more.
๐ŸŒ
Microsoft Learn
learn.microsoft.com โ€บ en-us โ€บ cpp โ€บ code-quality โ€บ code-analysis-for-c-cpp-overview
Code analysis for C/C++ overview | Microsoft Learn
The Microsoft C++ Code Analysis tool provides information about possible defects in your C/C++ source code. Common coding errors reported by the tool include buffer overruns, uninitialized memory, null pointer dereferences, and memory and resource ...
๐ŸŒ
Domsignal
domsignal.com โ€บ home โ€บ c online compiler | write, test, and execute c code in real-time
C Online Compiler | Write, Test, and Execute C Code in Real-Time
Effortlessly compile, test, and debug your C code online with Domsignal's Online C Compiler - your go-to tool for a seamless coding experience!
๐ŸŒ
NextLeap
nextleap.app โ€บ online-compiler โ€บ c-programming
NextLeap - Online C Compiler
Master the C programming language with NextLeap's C Online Compiler. Write, compile, and debug C code online in real time
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ compilers โ€บ online-c-compiler.htm
Online C Compiler & IDE - Write, Run & Debug C Code
Write, compile and run C code online for free. Features debugging, code sharing, examples and no installation required.
๐ŸŒ
CodeChef
codechef.com โ€บ c-online-compiler
Online C Compiler
Welcome to our AI-powered online C compiler, the perfect platform to run and test your C code efficiently. Our tool makes coding easy for developers of any skill level, whether you're a beginner or experienced.
๐ŸŒ
Online C / C++ Compiler
online-cpp.com โ€บ online_c_compiler
Online C Compiler | Compile & Run C Code Online โ€“ OnlineCPP
Compile and run C programs online instantly. Fast, secure online C compiler with real-time output, error checking, and no setup.
๐ŸŒ
CloudDefense.ai
clouddefense.ai โ€บ tools โ€บ code-checker โ€บ cpp
Best Cpp Code Checker Tool Online
Protect your Applications & Cloud Infastructure from attackers by leveraging CloudDefense.AI ACS patented technology ยท 579 University Ave, Palo Alto, CA 94301
๐ŸŒ
Llvm
clang-analyzer.llvm.org
Clang Static Analyzer
The term "static analysis" is conflated, but here we use it to mean a collection of algorithms and techniques used to analyze source code in order to automatically find bugs. The idea is similar in spirit to compiler warnings (which can be useful for finding coding errors) but to take that idea a step further and find bugs that are traditionally found using run-time debugging techniques such as testing. Static analysis bug-finding tools have evolved over the last several decades from basic syntactic checkers to those that find deep bugs by reasoning about the semantics of code.
๐ŸŒ
Boot.dev
boot.dev โ€บ playground โ€บ c
Online C Compiler - IDE, Editor and Playground | Boot.dev
2 weeks ago - Compile and run C code in the browser in our free code playground. Debug, edit and execute your programs in a syntax-highlighted online IDE.
๐ŸŒ
GS1
gs1.org โ€บ home โ€บ services โ€บ check digit calculator
Check digit calculator - Services | GS1
The last digit of a barcode number is a computer check digit which makes sure the barcode is correctly composed. Use our check digit calculator below to calculate a check digit.
๐ŸŒ
Snyk
snyk.io โ€บ code-checker
AI-powered Code Checker | Free AI Code Security Tool | AI Code Analysis | Snyk
Elevate your code quality and security with a modern, AI-backed tool that plays nicely with your workflow. A code checker is an automated software that statically analyzes source code and detects potential issues.