[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master 6e2e7265a04: Prefer static switch-case checking in pdumper
From: |
Eli Zaretskii |
Subject: |
Re: master 6e2e7265a04: Prefer static switch-case checking in pdumper |
Date: |
Sun, 26 Jan 2025 21:59:08 +0200 |
> Auto-Submitted: auto-generated
> Date: Sun, 26 Jan 2025 14:10:18 -0500 (EST)
> From: Stefan Kangas <stefankangas@gmail.com>
>
> branch: master
> commit 6e2e7265a04f63f482db7fbdfd8e2519d8bfe03e
> Author: Stefan Kangas <stefankangas@gmail.com>
> Commit: Stefan Kangas <stefankangas@gmail.com>
>
> Prefer static switch-case checking in pdumper
>
> * src/pdumper.c (dump_fwd, dump_symbol, dump_drain_cold_data)
> (dump_do_fixup, dump_anonymous_allocate_w32)
> (dump_anonymous_allocate_posix, dump_map_file_w32, dump_map_file_posix)
> (dump_do_emacs_relocation): Remove default clauses to allow static
> checking using -Wswitch.
This causes a compiler warning in a non-native-comp build:
pdumper.c: In function 'dump_drain_cold_data':
pdumper.c:3575:7: warning: enumeration value 'COLD_OP_NATIVE_SUBR' not
handled in switch [-Wswitch]
3575 | switch (op)
| ^~~~~~
We are using COLD_OP_NATIVE_SUBR inconsistently: on the one hand it is
defined unconditionally in the enumeration, and used unconditionally
in dump_subr; OTOH it is used in dump_drain_cold_data only in the
native-comp build. Which one do we want: define and use it in the
code unconditionally, or only if HAVE_NATIVE_COMP? If we want static
checks for switch values, we should decide either or.
- Re: master 6e2e7265a04: Prefer static switch-case checking in pdumper,
Eli Zaretskii <=