Merge branch 'master' into Remove-trailing-whitespace

This commit is contained in:
Jason Turner
2022-02-10 15:51:49 -07:00
committed by GitHub
4 changed files with 16 additions and 11 deletions

View File

@@ -35,6 +35,7 @@ Use an industry standard widely accepted build tool. This prevents you from rein
* [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/)
* [xmake](https://xmake.io) - A cross-platform build utility based on Lua. Modern C/C++ build tools, Support multi-language hybrid compilation
* [build2](https://build2.org) - A cargo-like complete toolchain (build system, package manager, project manager)
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.
@@ -46,9 +47,10 @@ Package management is an important topic in C++, with currently no clear winner.
* [hunter](https://github.com/ruslo/hunter) - CMake driven cross-platform package manager for C/C++
* [C++ Archive Network (CPPAN)](https://cppan.org/) - a crossplatform dependency manager for C++
* [qpm](https://www.qpm.io/) - Package manager for Qt
* [build2](https://build2.org/) - cargo-like package management for C++
* [build2](https://build2.org/) - A cargo-like complete toolchain (build system, package manager, project manager)
* [Buckaroo](https://buckaroo.pm) - Truly decentralized cross-platform dependency manager for C/C++ and more
* [Vcpkg](https://github.com/microsoft/vcpkg) - Microsoft C++ Library Manager for Windows, Linux, and MacOS - [description](https://docs.microsoft.com/en-us/cpp/build/vcpkg)
* [CPM](https://github.com/cpm-cmake/CPM.cmake) - CMake package manager for modern CMake
## Continuous Integration
@@ -101,8 +103,9 @@ You should use as many compilers as you can for your platform(s). Each compiler
### GCC / Clang
`-Wall -Wextra -Wshadow -Wnon-virtual-dtor -pedantic`
`-Wall -Wextra -Wshadow -Wnon-virtual-dtor -pedantic` - use these and consider the following (see descriptions below)
* `-pedantic` - Warn on language extensions
* `-Wall -Wextra` reasonable and standard
* `-Wshadow` warn the user if a variable declaration shadows one from a parent context
* `-Wnon-virtual-dtor` warn the user if a class with virtual functions has a non-virtual destructor. This helps catch hard to track down memory errors
@@ -293,6 +296,7 @@ A coverage analysis tool shall be run when tests are executed to make sure the e
### Reverse engineering tools
* [Cutter](https://cutter.re/) - A front-end for [Radare2](https://www.radare.org/n/radare2.html). It provides tools such as decompiler, disassembly, graph visualizer, hex editor.
* [Ghidra](https://ghidra-sre.org/) - Ghidra is a free and open source reverse engineering tool developed by the National Security Agency (NSA) of the United States.
### GCC / Clang Sanitizers
@@ -338,10 +342,6 @@ MSVC's [Control Flow Guard](https://msdn.microsoft.com/en-us/library/windows/des
* `_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).
### Heap Profiling
* [Memoro](https://epfl-vlsc.github.io/memoro/) - A detailed heap profiler
## Ignoring Warnings
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.

View File

@@ -80,7 +80,7 @@ private:
}
```
Why? Because passing and returning by reference leads to pointer operations instead by much more faster passing values in processor registers.
Why? Because passing and returning by reference leads to pointer operations, instead of much faster passing of values in processor registers.
## Avoid Raw Memory Access
@@ -142,4 +142,4 @@ If you have the possibility to use a compiler that supports C++11, you can use v
## Additional Resources
[How to Prevent The Next Heartbleed](http://www.dwheeler.com/essays/heartbleed.html) by David Wheeler is a good analysis of the current state of code safety and how to ensure safe code.
[How to Prevent The Next Heartbleed](https://dwheeler.com/essays/heartbleed.html) by David Wheeler is a good analysis of the current state of code safety and how to ensure safe code.

View File

@@ -103,8 +103,13 @@ If on Linux, consider using the gold linker for GCC.
There's no real way to know where your bottlenecks are without analyzing the code.
* http://developer.amd.com/tools-and-sdks/opencl-zone/codexl/
* http://www.codersnotes.com/sleepy
A list of code profilers:
* [Intel VTune](https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/vtune-profiler.html)
* [Coz - Causal Profiling](https://github.com/plasma-umass/coz)
* [Sleepy](http://www.codersnotes.com/sleepy)
* [Dyninst](https://dyninst.org/)
* [AMD CodeXL](https://github.com/GPUOpen-Archive/CodeXL)
* [lukestackwalker](http://lukestackwalker.sourceforge.net/)
### Simplify the Code

View File

@@ -9,6 +9,6 @@ For more information please see the [Preface](01-Preface.md).
This online resource is part of Jason Turner's collection of C++ Best Practices resources.
* [C++ Best Practices Book](https://leanpub.com/cppbestpractices)
* [C++ Weekly YouTube Channel](https://www.youtube.com/c/JasonTurner-lefticus)
* [C++ Weekly YouTube Channel](https://www.youtube.com/user/lefticus1)
* [The Ultimate CMake/C++ Starter Project](https://github.com/lefticus/cpp_starter_project/)
* [Learning C++ Best Practices - O'Reilly Video](http://shop.oreilly.com/product/0636920049814.do)