Subject: bug#75964: Switching the Emacs build to -Wswitch-enum in src/

From: Eli Zaretskii <[email-masked]>
Date: Sun, 02 Feb 2025 12:34:24 +0200

> Date: Sun, 02 Feb 2025 09:26:48 +0000
> From: Pip Cet <[email-masked]>
> Cc: [email-masked], [email-masked], [email-masked]
> 
> "Eli Zaretskii" <[email-masked]> writes:
> 
> >> Cc: [email-masked], Stefan Kangas <[email-masked]>
> >> Date: Sun, 02 Feb 2025 08:39:11 +0000
> >> From:  Pip Cet via "Bug reports for GNU Emacs,
> >>  the Swiss army knife of text editors" <[email-masked]>
> >>
> >> I think we should enable -Wswitch-enum now, and expect it to generate
> >> more warnings in the future.
> >
> > I'm not sure I understand what "in the future" means here, but please
> 
> Future GCC versions may and will add warnings about cases that they
> currently fail to warn about, for the same switch.  I don't think we can
> change that.

If future GCC versions add warnings, we will handle them when that
happens and the warnings are reported or seen.  We don't need (and
really cannot) worry about that at this time.

> > Apologies if the above is not relevant to what you were discussing
> > regarding adding warning options.
> 
> I think it's highly relevant: I proposed several ways of adding the
> warning options:  one file at a time, #pragma'd out, or enabled globally
> and only merged once we can fix, at least, the common build systems.

SGTM, thanks.

> Simply enabling them globally and waiting for someone else to fix the
> warnings only leads to other warnings being missed.

Right.