Skip to content

Commit 0336f01

Browse files
authored
Merge branch 'master' into master
2 parents 73500d4 + a09519f commit 0336f01

File tree

3 files changed

+25
-17
lines changed

3 files changed

+25
-17
lines changed

02-Use_the_Tools_Available.md

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Use an industry standard widely accepted build tool. This prevents you from rein
3434
* [Qt Build Suite](http://doc.qt.io/qbs/) - Crossplatform build tool From Qt.
3535
* [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.
3636
* [premake](https://premake.github.io/)
37-
37+
* [xmake](https://xmake.io) - A cross-platform build utility based on Lua. Modern C/C++ build tools, Support multi-language hybrid compilation
3838

3939
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.
4040

@@ -67,7 +67,7 @@ Continuous Integration (CI) tools automatically build the source code as changes
6767
* Java Application Server is required
6868
* supports Windows, OS X, and Linux
6969
* extendable with a lot of plugins
70-
* [TeamCity](https://www.jetbrains.com/teamcity)
70+
* [TeamCity](https://www.jetbrains.com/teamcity)
7171
* has a free option for open source projects
7272
* [Decent CI](https://github.com/lefticus/decent_ci)
7373
* simple ad-hoc continuous integration that posts results to GitHub
@@ -89,7 +89,7 @@ If you have an open source, publicly-hosted project on GitHub:
8989
* 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
9090
* enable one of the coverage tools listed below (Codecov or Coveralls)
9191
* enable [Coverity Scan](https://scan.coverity.com)
92-
92+
9393
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.
9494

9595

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

128128

@@ -165,7 +165,7 @@ Not recommended
165165

166166
Start with very strict warning settings from the beginning. Trying to raise the warning level after the project is underway can be painful.
167167

168-
Consider using the *treat warnings as errors* setting. `/Wx` with MSVC, `-Werror` with GCC / Clang
168+
Consider using the *treat warnings as errors* setting. `/WX` with MSVC, `-Werror` with GCC / Clang
169169

170170
## LLVM-based tools
171171

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

189189
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.
190190

191-
### Coverity Scan
191+
### Coverity Scan
192192

193193
[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/).
194194

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

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

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

212-
212+
213213
### CppDepend
214-
214+
215215
[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.
216216

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

239239
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.
240240

241-
### Cevelop
241+
### Cevelop
242242

243243
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.
244244

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

308308
### Fuzzy Analyzers
309309

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

312312
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.
313313

@@ -332,6 +332,10 @@ MSVC's [Control Flow Guard](https://msdn.microsoft.com/en-us/library/windows/des
332332

333333
* `_GLIBCXX_DEBUG` with GCC's implementation libstdc++ implementation. See [Krister's blog article](https://kristerw.blogspot.se/2018/03/detecting-incorrect-c-stl-usage.html).
334334

335+
### Heap Profiling
336+
337+
* [Memoro](https://epfl-vlsc.github.io/memoro/) - A detailed heap profiler
338+
335339
## Ignoring Warnings
336340

337341
If it is determined by team consensus that the compiler or analyzer is warning on something that is either incorrect or unavoidable, the team will disable the specific error to as localized part of the code as possible.
@@ -380,18 +384,22 @@ Don't forget to make sure that your error handling is being tested and works pro
380384

381385
[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.
382386

383-
### CNCC
387+
### CNCC
384388

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

387391
### ClangFormat
388392

389393
[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.
390394

391-
### SourceMeter
395+
### SourceMeter
392396

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

395399
### Bloaty McBloatface
396400

397401
[Bloaty McBloatface](https://github.com/google/bloaty) is a binary size analyzer/profiler for unix-like platforms
402+
403+
### pahole
404+
405+
[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.

09-Considering_Correctness.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ Consider using a typesafe library like
2121

2222
* https://foonathan.net/type_safe/
2323
* https://github.com/rollbear/strong_type
24+
* https://github.com/joboccara/NamedType
2425

2526
Note that stronger typing can also allow for more compiler optimizations.
2627

27-
2828
* [Sorting in C vs C++](Sorting in C vs C++.pdf)
2929

3030

SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* [Considering Portability](06-Considering_Portability.md)
99
* [Considering Threadability](07-Considering_Threadability.md)
1010
* [Considering Performance](08-Considering_Performance.md)
11-
* [Considering Correctness](09-Considering_Performance.md)
11+
* [Considering Correctness](09-Considering_Correctness.md)
1212
* [Enable Scripting](10-Enable_Scripting.md)
1313
* [Further Reading](11-Further_Reading.md)
1414
* [Final Thoughts](12-Final_Thoughts.md)

0 commit comments

Comments
 (0)