games/NXDoom: drop the assignments left over from dehacked - #3695
Merged
Conversation
Six statements assign a variable to itself, which clang rejects:
src/doom/f_finale.c:637:16: error: explicitly assigning value of
variable of type 'const char *' to itself [-Werror,-Wself-assign]
637 | lumpname = (lumpname);
Chocolate DOOM wraps those strings in DEH_String() so that a dehacked
patch can substitute them. The port has no dehacked support, and the
macro went away with it, leaving the parentheses behind. Two comments
that only described the substitution go as well.
Nothing changes at run time. GCC does not warn about this, so the
configurations built so far never noticed; the ones built with clang
do, and they fail because the CI treats warnings as errors.
Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
cederom
approved these changes
Aug 4, 2026
xiaoxiang781216
approved these changes
Aug 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Six statements in the NXDoom sources assign a variable to itself, which clang
rejects:
Chocolate DOOM wraps those strings in
DEH_String()so that a dehacked patchcan substitute them. The port has no dehacked support and the macro went away
with it, leaving the bare parentheses behind. This removes the six leftover
assignments, plus two comments that only described the substitution:
games/NXDoom/src/doom/f_finale.c:lumpname,finaletext,finaleflatgames/NXDoom/src/doom/g_game.c:skytexturename(two sites)games/NXDoom/src/doom/hu_stuff.c:sImpact
Build only, and only for configurations compiled with clang. GCC does not warn
about self-assignment, so the configurations built so far never noticed it;
clang does, and the build fails because the CI passes
-Werror(
tools/ci/cibuild.sh:-e "-Wno-cpp -Werror"). The nxdoom configurations aresim:nxdoom,linum-stm32h753bi:nxdoomandraspberrypi-4b:nxdoom.No functional change: the removed statements are no-ops. They were not entirely
free, though -- the nxdoom configurations build with
CONFIG_DEBUG_NOOPT=y, sothe redundant stores were actually emitted, and the image loses 16 bytes of
text (see the sizes below). No change to the API, configuration, build system
or documentation.
Testing
Host: Ubuntu 24.04.4 LTS, x86_64, Linux 7.0.0-28-generic
CONFIG_ARM_TOOLCHAIN_CLANG=y)Target: arm,
linum-stm32h753bi:nxdoomBoth builds use the same warning flags the CI uses:
make EXTRAFLAGS="-Wno-cpp -Werror".Before, clang
After, clang
Compiles with no warnings and no errors.
After, arm-none-eabi-gcc 13.2.1
Same configuration before the change, for comparison:
dataandbssare unchanged;textdrops the 16 bytes of the redundantstores.
Runtime
The resulting image was flashed on a LINUM-STM32H753BI over ST-LINK-V3 and
nxdoom was run from the NSH prompt: the game starts and plays exactly as it did
before the change, as expected for statements that had no effect.