GNU bug report logs - #75451
scratch/igc: Enable CHECK_STRUCTS

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefankangas <at> gmail.com>

Date: Thu, 9 Jan 2025 03:58:02 UTC

Severity: wishlist

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Gerd Möllmann <gerd.moellmann <at> gmail.com>
Cc: Pip Cet <pipcet <at> protonmail.com>, Stefan Kangas <stefankangas <at> gmail.com>, Gerd Moellmann <gerd <at> gnu.org>, 75451 <at> debbugs.gnu.org
Subject: bug#75451: scratch/igc: Enable CHECK_STRUCTS
Date: Fri, 10 Jan 2025 11:33:43 -0800
On 2025-01-10 10:58, Gerd Möllmann wrote:
> Stefan Kangas <stefankangas <at> gmail.com> writes:

>> I'm curios to know what is the experience while developing scratch/igc:
>> have these checks been very helpful?
> 
> It was helpful for me, in the pdumper, because I hadn't activated it in
> igc.c. Reason for it being that I have some other differences in my fork,
> like CL packages :-).

I haven't been developing in scratch/igc and so can't say anything there.

As I recall, CHECK_STRUCTS was introduced for pdumper and got in the way 
of everything else I developed, where it generated nothing but false alarms.

> I'm personally a big fan of exhaustive switches, as igc.c might show
> :-). I find they make it a lot easier to find all relevant places when
> adding enums. And I think the default case would work against that.

Yes, inserting 'default: emacs_abort ();' switches from static to 
dynamic checking, which is less reliable. Although 'default: emacs_abort 
();' is sometimes the best one can do, it's better to avoid it when 
possible.

I use 'default: eassume (false);' more often than 'default: emacs_abort 
();', though for a completely different purpose: to tell GCC something 
that it's not smart enough to figure out on its own, so that GCC can do 
better static checking elsewhere.




This bug report was last modified 105 days ago.

Previous Next


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