From 31598aaed10d56f56676a52b31d6898c002908a9 Mon Sep 17 00:00:00 2001 From: AristoChen Date: Tue, 30 Mar 2021 23:52:31 +0800 Subject: [PATCH 1/9] Remove duplicated content --- 02-Use_the_Tools_Available.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/02-Use_the_Tools_Available.md b/02-Use_the_Tools_Available.md index 15c4df7..5d40586 100644 --- a/02-Use_the_Tools_Available.md +++ b/02-Use_the_Tools_Available.md @@ -338,10 +338,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. From b99c3da548cd7dfdd97d61c9d9c9c216aaeef7d3 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 30 Mar 2021 19:48:26 -0500 Subject: [PATCH 2/9] Update the list of profilers --- 08-Considering_Performance.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/08-Considering_Performance.md b/08-Considering_Performance.md index 784ca33..9318611 100644 --- a/08-Considering_Performance.md +++ b/08-Considering_Performance.md @@ -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 From d7fd0817f570796692838f902228702353e4c69c Mon Sep 17 00:00:00 2001 From: Jonny Paton Date: Thu, 15 Apr 2021 10:42:32 +0100 Subject: [PATCH 3/9] Clarify GCC/Clang compiler flags Added a description for `-pedantic` and clarified similarly to the MSVC section --- 02-Use_the_Tools_Available.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/02-Use_the_Tools_Available.md b/02-Use_the_Tools_Available.md index 15c4df7..e991558 100644 --- a/02-Use_the_Tools_Available.md +++ b/02-Use_the_Tools_Available.md @@ -101,8 +101,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 From e6359bcb5cf90607e994bc88d692da1b2b0c189b Mon Sep 17 00:00:00 2001 From: Alexander Cai Date: Thu, 5 Aug 2021 01:14:02 -0600 Subject: [PATCH 4/9] Update 04-Considering_Safety.md fix link to heartbleed article --- 04-Considering_Safety.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/04-Considering_Safety.md b/04-Considering_Safety.md index 7136767..f799874 100644 --- a/04-Considering_Safety.md +++ b/04-Considering_Safety.md @@ -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. From 55b67e437d00278bf483d1120f4fdc1389ad84dc Mon Sep 17 00:00:00 2001 From: Soham Roy <72430659+sohamroy19@users.noreply.github.com> Date: Mon, 9 Aug 2021 10:16:11 +0530 Subject: [PATCH 5/9] Fixed broken youtube link in README.md Mentioned in #130 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5913527..ce16a60 100644 --- a/README.md +++ b/README.md @@ -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) From f3eb30f1020da78776cc4b372f9de62b367e0db5 Mon Sep 17 00:00:00 2001 From: simrego <37458367+simrego@users.noreply.github.com> Date: Wed, 18 Aug 2021 15:43:01 +0200 Subject: [PATCH 6/9] Update 02-Use_the_Tools_Available.md Maybe include Ghidra in reverse engineering tools? It has a lot of features. And I know this is an NSA program, but they already knows what have you done... ;) --- 02-Use_the_Tools_Available.md | 1 + 1 file changed, 1 insertion(+) diff --git a/02-Use_the_Tools_Available.md b/02-Use_the_Tools_Available.md index 15c4df7..2b7919b 100644 --- a/02-Use_the_Tools_Available.md +++ b/02-Use_the_Tools_Available.md @@ -293,6 +293,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 From 3104a4c183db86a331771a94420b84b039c6e1ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaim=20=28Jo=C3=ABl=20Lamotte=29?= <142265+Klaim@users.noreply.github.com> Date: Thu, 23 Dec 2021 22:58:18 +0100 Subject: [PATCH 7/9] Fixed slightly incorrect build2 references `build2` is a toolchain with both build-system and package manager (and a few other tools to help project management). This adds it to the build system list (it can be used with only the build system) and clarifies that it's a complete toolchain in both references. --- 02-Use_the_Tools_Available.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/02-Use_the_Tools_Available.md b/02-Use_the_Tools_Available.md index b44f707..5ffebb4 100644 --- a/02-Use_the_Tools_Available.md +++ b/02-Use_the_Tools_Available.md @@ -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,7 +47,7 @@ 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) From d506e2651334b94e693548417bfb2ac7133b701c Mon Sep 17 00:00:00 2001 From: Joey Hewitt Date: Wed, 26 Jan 2022 09:49:37 -0800 Subject: [PATCH 8/9] Considering_Safety typo fix --- 04-Considering_Safety.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/04-Considering_Safety.md b/04-Considering_Safety.md index f799874..5df8298 100644 --- a/04-Considering_Safety.md +++ b/04-Considering_Safety.md @@ -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 From 94af2ae300040b05f35835f74b34b1bb34913076 Mon Sep 17 00:00:00 2001 From: Cliff Burdick <30670611+cliffburdick@users.noreply.github.com> Date: Thu, 10 Feb 2022 14:50:24 -0800 Subject: [PATCH 9/9] Adds CPM to package managers (#140) --- 02-Use_the_Tools_Available.md | 1 + 1 file changed, 1 insertion(+) diff --git a/02-Use_the_Tools_Available.md b/02-Use_the_Tools_Available.md index 5ffebb4..25b59a0 100644 --- a/02-Use_the_Tools_Available.md +++ b/02-Use_the_Tools_Available.md @@ -50,6 +50,7 @@ Package management is an important topic in C++, with currently no clear winner. * [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