Merge branch 'master' into patch-1

This commit is contained in:
Jason Turner
2020-05-17 08:22:00 -06:00
committed by GitHub
3 changed files with 21 additions and 17 deletions

View File

@@ -33,7 +33,7 @@ Use an industry standard widely accepted build tool. This prevents you from rein
* [Qt Build Suite](http://doc.qt.io/qbs/) - Crossplatform build tool From Qt. * [Qt Build Suite](http://doc.qt.io/qbs/) - Crossplatform build tool From Qt.
* [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. * [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.
* [premake](https://premake.github.io/) * [premake](https://premake.github.io/)
* [xmake](https://xmake.io) - A cross-platform build utility based on Lua. Modern C/C++ build tools, Support multi-language hybrid compilation
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. 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
* Java Application Server is required * Java Application Server is required
* supports Windows, OS X, and Linux * supports Windows, OS X, and Linux
* extendable with a lot of plugins * extendable with a lot of plugins
* [TeamCity](https://www.jetbrains.com/teamcity) * [TeamCity](https://www.jetbrains.com/teamcity)
* has a free option for open source projects * has a free option for open source projects
* [Decent CI](https://github.com/lefticus/decent_ci) * [Decent CI](https://github.com/lefticus/decent_ci)
* simple ad-hoc continuous integration that posts results to GitHub * 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:
* 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 * 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
* enable one of the coverage tools listed below (Codecov or Coveralls) * enable one of the coverage tools listed below (Codecov or Coveralls)
* enable [Coverity Scan](https://scan.coverity.com) * enable [Coverity Scan](https://scan.coverity.com)
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. 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.
@@ -121,7 +121,7 @@ You should use as many compilers as you can for your platform(s). Each compiler
* `-Wdouble-promotion` (GCC >= 4.6, Clang >= 3.8) warn if `float` is implicit promoted to `double` * `-Wdouble-promotion` (GCC >= 4.6, Clang >= 3.8) warn if `float` is implicit promoted to `double`
* `-Wformat=2` warn on security issues around functions that format output (ie `printf`) * `-Wformat=2` warn on security issues around functions that format output (ie `printf`)
* `-Wlifetime` (only special branch of Clang currently) shows object lifetime issues * `-Wlifetime` (only special branch of Clang currently) shows object lifetime issues
Consider using `-Weverything` and disabling the few warnings you need to on Clang Consider using `-Weverything` and disabling the few warnings you need to on Clang
@@ -164,7 +164,7 @@ Not recommended
Start with very strict warning settings from the beginning. Trying to raise the warning level after the project is underway can be painful. Start with very strict warning settings from the beginning. Trying to raise the warning level after the project is underway can be painful.
Consider using the *treat warnings as errors* setting. `/Wx` with MSVC, `-Werror` with GCC / Clang Consider using the *treat warnings as errors* setting. `/WX` with MSVC, `-Werror` with GCC / Clang
## LLVM-based tools ## LLVM-based tools
@@ -187,7 +187,7 @@ CMake now also comes with built-in support for calling `clang-tidy` during [norm
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. 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.
### Coverity Scan ### Coverity Scan
[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/). [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/).
@@ -201,16 +201,16 @@ The best bet is the static analyzer that you can run as part of your automated b
Notes: Notes:
* For correct work it requires well formed path for headers, so before usage don't forget to pass: `--check-config`. * For correct work it requires well formed path for headers, so before usage don't forget to pass: `--check-config`.
* Finding unused headers does not work with `-j` more than 1. * Finding unused headers does not work with `-j` more than 1.
* Remember to add `--force` for code with a lot number of `#ifdef` if you need check all of them. * Remember to add `--force` for code with a lot number of `#ifdef` if you need check all of them.
### cppclean ### cppclean
[cppclean](https://github.com/myint/cppclean) - Open source static analyzer focused on finding problems in C++ source that slow development of large code bases. [cppclean](https://github.com/myint/cppclean) - Open source static analyzer focused on finding problems in C++ source that slow development of large code bases.
### CppDepend ### CppDepend
[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. [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.
### Clang's Static Analyzer ### Clang's Static Analyzer
@@ -237,7 +237,7 @@ Can be enabled with the `/analyze` [command line option](http://msdn.microsoft.c
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. 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.
### Cevelop ### Cevelop
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. 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.
@@ -267,7 +267,7 @@ A coverage analysis tool shall be run when tests are executed to make sure the e
* integrates with Travis CI and AppVeyor * integrates with Travis CI and AppVeyor
* free for open source projects * free for open source projects
* [LCOV](http://ltp.sourceforge.net/coverage/lcov.php) * [LCOV](http://ltp.sourceforge.net/coverage/lcov.php)
* very configurable * very configurable
* [Gcovr](http://gcovr.com/) * [Gcovr](http://gcovr.com/)
* [kcov](http://simonkagstrom.github.io/kcov/index.html) * [kcov](http://simonkagstrom.github.io/kcov/index.html)
* integrates with codecov and coveralls * integrates with codecov and coveralls
@@ -296,7 +296,7 @@ Be aware of the sanitizer options available, including runtime options. https://
### Fuzzy Analyzers ### Fuzzy Analyzers
If your project accepts user defined input, considering running a fuzzy input tester. If your project accepts user defined input, considering running a fuzzy input tester.
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. 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.
@@ -373,7 +373,7 @@ Don't forget to make sure that your error handling is being tested and works pro
[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. [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.
### CNCC ### CNCC
[Customizable Naming Convention Checker](https://github.com/mapbox/cncc) can report on identifiers in your code that do not follow certain naming conventions. [Customizable Naming Convention Checker](https://github.com/mapbox/cncc) can report on identifiers in your code that do not follow certain naming conventions.
@@ -381,10 +381,14 @@ Don't forget to make sure that your error handling is being tested and works pro
[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. [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.
### SourceMeter ### SourceMeter
[SourceMeter](https://www.sourcemeter.com/) offers a free version which provides many different metrics for your code and can also call into cppcheck. [SourceMeter](https://www.sourcemeter.com/) offers a free version which provides many different metrics for your code and can also call into cppcheck.
### Bloaty McBloatface ### Bloaty McBloatface
[Bloaty McBloatface](https://github.com/google/bloaty) is a binary size analyzer/profiler for unix-like platforms [Bloaty McBloatface](https://github.com/google/bloaty) is a binary size analyzer/profiler for unix-like platforms
### pahole
[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.

View File

@@ -21,10 +21,10 @@ Consider using a typesafe library like
* https://foonathan.net/type_safe/ * https://foonathan.net/type_safe/
* https://github.com/rollbear/strong_type * https://github.com/rollbear/strong_type
* https://github.com/joboccara/NamedType
Note that stronger typing can also allow for more compiler optimizations. Note that stronger typing can also allow for more compiler optimizations.
* [Sorting in C vs C++](Sorting in C vs C++.pdf) * [Sorting in C vs C++](Sorting in C vs C++.pdf)

View File

@@ -8,7 +8,7 @@
* [Considering Portability](06-Considering_Portability.md) * [Considering Portability](06-Considering_Portability.md)
* [Considering Threadability](07-Considering_Threadability.md) * [Considering Threadability](07-Considering_Threadability.md)
* [Considering Performance](08-Considering_Performance.md) * [Considering Performance](08-Considering_Performance.md)
* [Considering Correctness](09-Considering_Performance.md) * [Considering Correctness](09-Considering_Correctness.md)
* [Enable Scripting](10-Enable_Scripting.md) * [Enable Scripting](10-Enable_Scripting.md)
* [Further Reading](11-Further_Reading.md) * [Further Reading](11-Further_Reading.md)
* [Final Thoughts](12-Final_Thoughts.md) * [Final Thoughts](12-Final_Thoughts.md)