Technical requirements
To get the most out of this chapter, I strongly recommend using Compiler Explorer (https://godbolt.org/) as you read through the examples. Select GCC as your compiler and target x86 architecture. This will allow you to see standard output (stdio) results and better observe the code’s behavior. As we are using modern C++ features make sure to select C++23 standard, by adding -std=c++23
in compiler options box.
Compiler Explorer makes it easy to try out the code, tweak it, and immediately see how it affects the output and generated assembly. The examples are available at GitHub (https://github.com/PacktPublishing/Cpp-in-Embedded-Systems/tree/main/Chapter06).