10000 Merge pull request #122 from timwoj/master · googol-lab/cppbestpractices@005bc6b · GitHub
[go: up one dir, main page]

Skip to content

Commit 005bc6b

Browse files
authored
Merge pull request cpp-best-practices#122 from timwoj/master
Add pahole to the list of other tools
2 parents 9486df2 + 6e6e506 commit 005bc6b

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

02-Use_the_Tools_Available.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Use an industry standard widely accepted build tool. This prevents you from rein
3232
* [maiken](https://github.com/Dekken/maiken) - Crossplatform build tool with Maven-esque configuration style.
3333
* [Qt Build Suite](http://doc.qt.io/qbs/) - Crossplatform build tool From Qt.
3434
* [meson](http://mesonbuild.com/index.html) - Open source build system meant to be both extremely fast, and, even more importantly, as user friendly as possible.
35-
* [premake](https://premake.github.io/)
35+
* [premake](https://premake.github.io/)
3636

3737

3838
Remember, it's not just a build tool, it's also a programming language. Try to maintain good clean build scripts and follow the recommended practices for the tool you are using.
@@ -66,7 +66,7 @@ Continuous Integration (CI) tools automatically build the source code as changes
6666
* Java Application Server is required
6767
* supports Windows, OS X, and Linux
6868
* extendable with a lot of plugins
69-
* [TeamCity](https://www.jetbrains.com/teamcity)
69+
* [TeamCity](https://www.jetbrains.com/teamcity)
7070
* has a free option for open source projects
7171
* [Decent CI](https://github.com/lefticus/decent_ci)
7272
* simple ad-hoc continuous integration that posts results to GitHub
@@ -88,7 +88,7 @@ If you have an open source, publicly-hosted project on GitHub:
8888
* go enable Travis Ci and AppVeyor integration right now. We'll wait for you to come back. For a simple example of how to enable it for your C++ CMake-based application, see here: https://github.com/ChaiScript/ChaiScript/blob/master/.travis.yml
8989
* enable one of the coverage tools listed below (Codecov or Coveralls)
9090
* enable [Coverity Scan](https://scan.coverity.com)
91-
91+
9292
These tools are all free and relatively easy to set up. Once they are set up you are getting continuous building, testing, analysis and reporting of your project. For free.
9393

9494

@@ -121,7 +121,7 @@ You should use as many compilers as you can for your platform(s). Each compiler
121121
* `-Wdouble-promotion` (GCC >= 4.6, Clang >= 3.8) warn if `float` is implicit promoted to `double`
122122
* `-Wformat=2` warn on security issues around functions that format output (ie `printf`)
123123
* `-Wlifetime` (only special branch of Clang currently) shows object lifetime issues
124-
124+
125125
Consider using `-Weverything` and disabling the few warnings you need to on Clang
126126

127127

@@ -187,7 +187,7 @@ CMake now also comes with built-in support for calling `clang-tidy` during [norm
187187

188188
The best bet is the static analyzer that you can run as part of your automated build system. Cppcheck and clang meet that requirement for free options.
189189

190-
### Coverity Scan
190+
### Coverity Scan
191191

192192
[Coverity](https://scan.coverity.com/) has a free (for open source) static analysis toolkit that can work on every commit in integration with [Travis CI](http://travis-ci.org) and [AppVeyor](http://www.appveyor.com/).
193193

@@ -201,16 +201,16 @@ The best bet is the static analyzer that you can run as part of your automated b
201201
Notes:
202202

203203
* For correct work it requires well formed path for headers, so before usage don't forget to pass: `--check-config`.
204-
* Finding unused headers does not work with `-j` more than 1.
204+
* Finding unused headers does not work with `-j` more than 1.
205205
* Remember to add `--force` for code with a lot number of `#ifdef` if you need check all of them.
206-
206+
207207
### cppclean
208208

209209
[cppclean](https://github.com/myint/cppclean) - Open source static analyzer focused on finding problems in C++ source that slow development of large code bases.
210210

211-
211+
212212
### CppDepend
213-
213+
214214
[CppDepend](https://www.cppdepend.com/) Simplifies managing a complex C/C++ code base by analyzing and visualizing code dependencies, by defining design rules, by doing impact analysis, and comparing different versions of the code. It's free for OSS contributors.
215215

216216
### Clang's Static Analyzer
@@ -237,7 +237,7 @@ Can be enabled with the `/analyze` [command line option](http://msdn.microsoft.c
237237

238238
Both of these tools from [JetBrains](https://www.jetbrains.com/cpp/) offer some level of static analysis and automated fixes for common things that can be done better. They have options available for free licenses for open source project leaders.
239239

240-
### Cevelop
240+
### Cevelop
241241

242242
The Eclipse based [Cevelop](https://www.cevelop.com/) IDE has various static analysis and refactoring / code fix tools available. For example, you can replace macros with C++ `constexprs`, refactor namespaces (extract/inline `using`, qualify name), and refactor your code to C++11's uniform initialization syntax. Cevelop is free to use.
243243

@@ -267,7 +267,7 @@ A coverage analysis tool shall be run when tests are executed to make sure the e
267267
* integrates with Travis CI and AppVeyor
268268
* free for open source projects
269269
* [LCOV](http://ltp.sourceforge.net/coverage/lcov.php)
270-
* very configurable
270+
* very configurable
271271
* [Gcovr](http://gcovr.com/)
272272
* [kcov](http://simonkagstrom.github.io/kcov/index.html)
273273
* integrates with codecov and coveralls
@@ -296,7 +296,7 @@ Be aware of the sanitizer options available, including runtime options. https://
296296

297297
### Fuzzy Analyzers
298298

299-
If your project accepts user defined input, considering running a fuzzy input tester.
299+
If your project accepts user defined input, considering running a fuzzy input tester.
300300

301301
Both of these tools use coverage reporting to find new code execution paths and try to breed novel inputs for your code. They can find crashes, hangs, and inputs you didn't know were considered valid.
302302

@@ -323,7 +323,7 @@ MSVC's [Control Flow Guard](https://msdn.microsoft.com/en-us/library/windows/des
323323

324324
### Heap Profiling
325325

326-
* [https://epfl-vlsc.github.io/memoro/](Memoro) - A detailed heap profiler
326+
* [https://epfl-vlsc.github.io/memoro/](Memoro) - A detailed heap profiler
327327

328328
## Ignoring Warnings
329329

@@ -373,18 +373,22 @@ Don't forget to make sure that your error handling is being tested and works pro
373373

374374
[ABI Compliance Checker](http://ispras.linuxbase.org/index.php/ABI_compliance_checker) (ACC) can analyze two library versions and generates a detailed compatibility report regarding API and C++ ABI changes. This can help a library developer spot unintentional breaking changes to ensure backward compatibility.
375375

376-
### CNCC
376+
### CNCC
377377

378378
[Customizable Naming Convention Checker](https://github.com/mapbox/cncc) can report on identifiers in your code that do not follow certain naming conventions.
379379

380380
### ClangFormat
381381

382382
[ClangFormat](http://clang.llvm.org/docs/ClangFormat.html) can check and correct code formatting to match organizational conventions automatically. [Multipart series](https://engineering.mongodb.com/post/succeeding-with-clangformat-part-1-pitfalls-and-planning/) on utilizing clang-format.
383383

384-
### SourceMeter
384+
### SourceMeter
385385

386386
[SourceMeter](https://www.sourcemeter.com/) offers a free version which provides many different metrics for your code and can also call into cppcheck.
387387

388388
### Bloaty McBloatface
389389

390390
[Bloaty McBloatface](https://github.com/google/bloaty) is a binary size analyzer/profiler for unix-like platforms
391+
392+
### pahole
393+
394+
[pahole](https://linux.die.net/man/1/pahole) generates data on holes in the packing of data structures and classes in compiled code. It can also the size of structures and how they fit within the system's cache lines.

0 commit comments

Comments
 (0)
0