Open pdgendt opened 1 month ago
Using the link you attached, it looks like they split them between compile-time and run-time. Could we make them groups and keep the compile-time and run-time separated with subgroups?
@pdgendt what do you think?
Using the link you attached, it looks like they split them between compile-time and run-time. Could we make them groups and keep the compile-time and run-time separated with subgroups?
I still need to invest some time in the options and what they do, if someone has proposals on how to group, that would be very helpful. I have limited bandwidth, so it will take some time to make progress.
Is your enhancement proposal related to a problem? Please describe. Enabling compiler warning options and treating them as errors is in many cases not an easy task, and not a one-man-show. This issue is to track compiler options that could become default enabled, to be verified in CI.
A recent article sums up nicely what this can entail: https://best.openssf.org/Compiler-Hardening-Guides/Compiler-Options-Hardening-Guide-for-C-and-C++.html
Describe the solution you'd like
Describe alternatives you've considered There is a
Kconfig
optionCODING_GUIDELINE_CHECK
(see #71493) but this triggers too many warnings at once, and instead of trying to fix the world we should go step by step.Additional context This issue is created as discussed by the process working group to track compiler related options.
Proposal WIP
These are loosely based on the current GCC toolchain flags in-tree.
Base
-Wall
-Wdouble-promotion
-Wexpansion-to-defined
-Wformat
-Wpointer-arith
Exceptions
-Wno-pointer-sign
Level 1
-Waggregate-return
-Wcast-align
-Wconversion
-Wdisabled-optimization
-Wimplicit-fallthrough
-Wlogical-op
-Wmissing-field-initializers
-Wnested-externs
-Wshadow
Optionally go for
-Wextra
Level 2
-Wbad-function-cast
-Wcast-qual
-Wpacked
-Wpadded
-Wpointer-arith
-Wredundant-decls
-Wswitch-default
-Wpacked-bitfield-compat
-Wvla
Level 3
TODO