From af9ef6bd6e694dd54112ea2b2a00ac202c723eb0 Mon Sep 17 00:00:00 2001 From: Ryan Friedman Date: Sat, 20 Jan 2024 15:19:20 -0700 Subject: [PATCH] Add _GLIBCXX_ASSERTIONS to recommended compiler flags Signed-off-by: Ryan Friedman --- 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 8e987a4..87dc229 100644 --- a/02-Use_the_Tools_Available.md +++ b/02-Use_the_Tools_Available.md @@ -126,6 +126,7 @@ You should use as many compilers as you can for your platform(s). Each compiler * `-Wformat=2` warn on security issues around functions that format output (i.e., `printf`) * `-Wlifetime` (only special branch of Clang currently) shows object lifetime issues * `-Wimplicit-fallthrough` Warns when case statements fall-through. (Included with `-Wextra` in GCC, not in clang) + * `-D_GLIBCXX_ASSERTIONS` (only in GCC >= TBD) Adds extra assertions, null pointer checks. Do not enable this on release builds because it is slow. Consider using `-Weverything` and disabling the few warnings you need to on Clang