GNU bug report logs - #75964
Switching the Emacs build to -Wswitch-enum in src/

Previous Next

Package: emacs;

Reported by: Pip Cet <pipcet <at> protonmail.com>

Date: Fri, 31 Jan 2025 09:41:02 UTC

Severity: wishlist

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Pip Cet <pipcet <at> protonmail.com>
Cc: eggert <at> cs.ucla.edu, 75964 <at> debbugs.gnu.org, stefankangas <at> gmail.com
Subject: bug#75964: Switching the Emacs build to -Wswitch-enum in src/
Date: Sun, 02 Feb 2025 12:34:24 +0200
> Date: Sun, 02 Feb 2025 09:26:48 +0000
> From: Pip Cet <pipcet <at> protonmail.com>
> Cc: eggert <at> cs.ucla.edu, 75964 <at> debbugs.gnu.org, stefankangas <at> gmail.com
> 
> "Eli Zaretskii" <eliz <at> gnu.org> writes:
> 
> >> Cc: 75964 <at> debbugs.gnu.org, Stefan Kangas <stefankangas <at> gmail.com>
> >> 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" <bug-gnu-emacs <at> gnu.org>
> >>
> >> 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.




This bug report was last modified 127 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.