include-what-you-use
A tool for use with clang to analyze #includes in C and C++ source files (by include-what-you-use)
Cppcheck
static analysis of C/C++ code (by danmar)
Our great sponsors
include-what-you-use | Cppcheck | |
---|---|---|
39 | 11 | |
3,819 | 5,448 | |
2.4% | - | |
9.4 | 9.9 | |
5 days ago | 5 days ago | |
C++ | C++ | |
GNU General Public License v3.0 or later | GNU General Public License v3.0 only |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
include-what-you-use
Posts with mentions or reviews of include-what-you-use.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-08-05.
- IWYU: A tool for use with Clang to analyze includes in C and C++ source files
-
Script to find missing std includes in C++ headers
Interesting...how does it compare to https://github.com/include-what-you-use/include-what-you-use ?
-
Speed Up C++ Compilation
Build Insights in Visual Studio, include-what-you-use).
Looks like https://include-what-you-use.org/ might do that.
-
Is it good or bad practice to include headers that are indirectly included from other headers?
If you are worried about includes, use https://github.com/include-what-you-use/include-what-you-use and stop thinking about it.
-
how do you guys manage a include file mess ?
Getting rid of that is not straightforard, though some tools can help with that
-
Is it appropiate to comment what a header is needed for?
You can use the tool https://github.com/include-what-you-use/include-what-you-use to do this for for. It tracks included files and can give comment for what is used from each file. It also warns you when you include files that you don’t use
-
Hey Rustaceans! Got a question? Ask here (16/2023)!
Invisible imports (e.g. traits). In Python, everything is fully namespaced (unless you from import * in which case all bets are off). It's always explicit where a name is coming from. C is the opposite: #include lets you refer to anything defined in the headers with no namespacing. That's why a common strategy (include what you use) has an associated code style: after every non-std #include you have a comment saying which of its definitions you are using. Of course, Rust is much less implicit, but I still sometimes struggle with traits. For example, you can use tokio::net::TcpStream, but you need to also use tokio::io::AsyncReadExt for the .read trait to be defined on TcpStream. This makes it hard (for me) to answer questions like "what traits are currently available in this scope?" and "why is this module being imported?"
- I implemented a NASA image compression algorithm
-
IncludeGuardian - improve build times by removing expensive includes
Aside from being closed source and not available on all architectures, how does it compare to iwyu(https://include-what-you-use.org/) or clang's relatively recent include-fixer which is also accessible via clangd?
-
Do you include standard library headers in your implementation file, if they're already been included in the corresponding header file?
I set up include-what-you-use and I let it tell me which headers should be where. The IWYU rules would have put all needed headers including in the cpp file.
Cppcheck
Posts with mentions or reviews of Cppcheck.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2024-03-04.
-
Configuring Cppcheck, Cpplint, and JSON Lint
I dedicated Sunday morning to going over the documentation of the linters we use in the project. The goal was to understand all options and use them in the best way for our project. Seeing their manuals side by side was nice because even very similar things are solved differently. Cppcheck is the most configurable and best documented; JSON Lint lies at the other end.
- Cppcheck/Releasenotes.txt
-
Enforcing Memory Safety?
Using infer, someone else exploited null-dereference checks to introduce simple affine types in C++. Cppcheck also checks for null-dereferences. Unfortunately, that approach means that borrow-counting references have a larger sizeof than non-borrow counting references, so optimizing the count away potentially changes the semantics of a program which introduces a whole new way of writing subtly wrong code.
-
Check out my tasks.json for C++ of VScode
Also check out (cppcheck)[https://github.com/danmar/cppcheck] if you want more static analysis
-
What are the must-have tools for any C++ developer?
My browser refuses to open that link. This is better: https://github.com/danmar/cppcheck
-
Awesome Penetration Testing
cppcheck - Extensible C/C++ static analyzer focused on finding bugs.
-
C/C++ pre-commit hooks for static analyzers and linters
and five C/C++ static code analyzers: * clang-tidy * oclint * cppcheck * cpplint (recently added!) * include-what-you-use (recently added!)
-
Caught signal 11 (SIGSEGV) and signal 6 (SIGABRT)
Start by feeding your codebase to a static analysis tool like cppcheck, to rule out obvious bound-checking mistakes in it.
- How to detect stack corruption in embedded c??
-
Why static analysis on C projects is not widespread already?
Cppcheck is free. I've previously used it with a C++ project.
What are some alternatives?
When comparing include-what-you-use and Cppcheck you can also consider the following projects:
cppinclude - Tool for analyzing includes in C++
cpplint - Static code checker for C++
coc-clangd - clangd extension for coc.nvim
gcc-poison - gcc-poison
stb - stb single-file public domain libraries for C/C++
clangd - clangd language server
cmake-lint - Fork of https://github.com/richq/cmake-lint to continue maintenance
uncrustify - Code beautifier
American Fuzzy Lop - american fuzzy lop - a security-oriented fuzzer
pre-commit - A framework for managing and maintaining multi-language pre-commit hooks.
c-smart-pointers - Smart pointers for the (GNU) C programming language
include-what-you-use vs cppinclude
Cppcheck vs cpplint
include-what-you-use vs coc-clangd
Cppcheck vs gcc-poison
include-what-you-use vs cpplint
Cppcheck vs stb
include-what-you-use vs clangd
Cppcheck vs cmake-lint
include-what-you-use vs uncrustify
Cppcheck vs American Fuzzy Lop
include-what-you-use vs pre-commit
Cppcheck vs c-smart-pointers