https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102276

--- Comment #12 from qinzhao at gcc dot gnu.org ---
I will go with the following solution:

1. avoid emitting switch-unreachable warnings for -ftrivial-auto-var-init;
2. adding a new option -Wtrivial-auto-var-init to emit warnings for the
switch-unreadable cases to suggest the user modify the source code;
3. update documentation of -ftrivial-auto-var-init for the limitation on
switch-unreachable cases and introduce the new option -Wtrivial-auto-var-init

with the above 1, we can resolve the current immediate issue of spurious
warnings of using -ftrivial-auto-var-init to make kernel build succeed;
with the above 2, we provide the user a way to know that
-ftrivial-auto-var-init has limitation on the switch-unreachable cases, and
user should modify the source code to avoid this problem;
with the above 3, we will provide the user a clear documentation of the
-ftrivial-auto-var-init and also provide suggestions how to resolve this issue. 

I will update my current patch with this.

let me know if you have other comments and suggestions.

Reply via email to