GNU bug report logs -
#75451
scratch/igc: Enable CHECK_STRUCTS
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
On 1/27/25 03:07, Pip Cet wrote:
> "Paul Eggert" <eggert <at> cs.ucla.edu> writes:
>
>> GCC complained in my builds after some pdumper.c changes were added
>> today in this area. I pacified GCC by installing the attached further
>
> Did you build with optimization?
Yes. --enable-gcc-warnings doesn't make much sense otherwise.
> . we lose the -Wswitch warning entirely this way.
Yes, unfortunately (and as I mentioned in the commit message).
> 2. GCC generates an equivalent table itself when building with
> optimization, if it can do so.
Heh, I didn't know that. Though I didn't see that in my little tests
when compiling with default -O2 optimization. For example, if I compile
the attached with gcc -std=gnu23 -O2 -S, 'dotab' has one indexed jump
whereas 'doswitch' has three conditional branches. Not clear to me which
is faster in practice. I used x86-64 gcc (GCC) 14.2.1 20250110 (Red Hat
14.2.1-7).
> The warnings are annoying, so maybe we should go back to the "default:
> emacs_abort();" solution for now, or switch to "default: eassume (0);"
Between the two I would prefer the latter. "default: eassume (false);"
will crash reliably if you use compiler flags like -fsanitize=undefined,
and that should be good enough for this sort of thing.
[t.c (text/x-csrc, attachment)]
This bug report was last modified 159 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.