Here's a few more we use:
-Wvla
Warn about any use of stack-allocated variable length arrays. There are a couple of reasons why these are bad: without care they can cause exploits where a caller specifies a very large array which crashes the program. And they are a problem where stack space is limited (kernel code, threads on 32 bit machines).
-Wframe-larger-than=5000 -Wstack-usage=10000
Prevent large stack frames. Same reasons as above.
-Wshadow
Prevent shadowed variables, eg. a local variable with the same name as a global.
-Werror
Turn warnings into errors. Only use this for developer builds though, because newer compilers introduce new warnings and that will cause problems for downstream packagers.
-fno-omit-frame-pointer
https://rwmj.wordpress.com/2023/02/14/frame-pointers-vs-dwar... -fvisibility=hidden
When building a library, make sure all symbols between compilation units but within the library are not exported. Basically reduces the load-time overhead and prevents random ELF symbol interposition. If you use this, then to export a symbol you have to use '__attribute__((__visibility__("default")))'.
-fno-strict-overflow -Wno-strict-overflow
(Controversially) unbreaks the C compiler by allowing signed overflows to do the obvious thing.