From 71223d54c9d6e66742e97f6d2ea1e4d668db41e5 Mon Sep 17 00:00:00 2001 From: Carl Pearson Date: Wed, 2 Mar 2022 06:43:44 -0700 Subject: [PATCH] . --- content/post/20220301-gcc-flags/index.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/content/post/20220301-gcc-flags/index.md b/content/post/20220301-gcc-flags/index.md index 0b75615..9ebf676 100644 --- a/content/post/20220301-gcc-flags/index.md +++ b/content/post/20220301-gcc-flags/index.md @@ -47,17 +47,17 @@ The summaries are taken from https://gcc.gnu.org/onlinedocs/gcc/Warning-Options. * `-Wcast-align`: warn whenever a pointer is cast such that the required alignment is increased (`char*` -> `int*`). * `-Wcast-qual`: warn when qualifier (`cosnst`) is cast away, or introduces a qualifier in an unsafe way. * `-Wdisabled-optimization`: warn if a requested optimization pass is disable. -* `-Wduplicated-branches`: warn if if-else branches have identical bodies -* `-Wduplicated-cond`: warn about duplicated conditions in an if-else-if chain +* `-Wduplicated-branches`: warn if if-else branches have identical bodies. +* `-Wduplicated-cond`: warn about duplicated conditions in an if-else-if chain. * `-Wformat=2`: same as `-Wformat` `-Wformat-nonliteral` `-Wformat-security` `-Wformat-y2k`. make sure printf-style function arguments match their format strings. * `-Wlogical-op`: warn about suspicious use of logical operators, i.e. contexts where bitwise is more likely. * `-Wmissing-include-dirs`: warn if a user-supplied include dir does not exist. -* `-Wnull-dereference`: warn if paths that dereference a null pointer are detected +* `-Wnull-dereference`: warn if paths that dereference a null pointer are detected. * `-Woverloaded-virtual`: warn when a function declaration hides virtual functions from a base class -* `-Wpointer-arith`: warn about `sizeof` for function types or `void` -* `-Wshadow`: warn about variable shadowing and global function shadowing -* `-Wswitch-enum`: warn when a `switch` on an enum type is missing one of the enums -* `-Wvla`: warn about using variable-length arrays +* `-Wpointer-arith`: warn about `sizeof` for function types or `void`. +* `-Wshadow`: warn about variable shadowing and global function shadowing. +* `-Wswitch-enum`: warn when a `switch` on an enum type is missing one of the enums. +* `-Wvla`: warn about using variable-length arrays. Also, in debug mode: