C++ Compiler Flags for Development

Channel:
Subscribers:
2,650
Published on ● Video Link: https://www.youtube.com/watch?v=ruFzOtPoGgI



Duration: 19:20
286 views
11


I split the lecture in two since this first part on compiler flags for safe development is worth its own lecture. C++ defaults to "fast and unsafe" for all of its options. Today I showed how to make C++ "slow and safe" for development, which gives you basically the same safety as Java without actually having to use Java.

I have been spreading the word about ASAN (Address Sanitizer) for years, and even though word has been spreading, it's still worth emphasizing that everyone should know about compiling with -fsanitize=address when doing development to check for memory errors at runtime.

The Safe Standard Library is also something not well known by most people, and so turning that on when doing development is also a really good idea.







Tags:
address sanitizer
asan
ubsan
g++
safe standard library
compiler flags