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: Paul Eggert <eggert <at> cs.ucla.edu>
To: Pip Cet <pipcet <at> protonmail.com>
Cc: 75964 <at> debbugs.gnu.org, Stefan Kangas <stefankangas <at> gmail.com>
Subject: bug#75964: Switching the Emacs build to -Wswitch-enum in src/
Date: Sun, 2 Feb 2025 00:31:47 -0800
On 2025-02-02 00:21, Pip Cet wrote:

> emacs_abort () isn't equivalent to eassert (false), and that's
> always been confusing to me.

The inspiration is emacs_abort : abort :: eassert : assert. If we made 
emacs_abort () equivalent to eassert (false) we'd break that, as in C 
abort () is not equivalent to assert (false).

> can't we just enable
> -Wswitch-enum and people live with what they get?

Yes, if the new -Wswitch-enum behavior is in stable GCC and if Emacs 
compiles cleanly with the new GCC. Come to think of it, that'd be better 
than autoconfery.

In other words, I'm thinking that the change to Emacs can wait until GCC 
is fixed, and once that happens we can change Emacs. We shouldn't need 
to fiddle with configure.ac or with Makefiles or whatever, other than to 
add -Wswitch-enum.




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.