fix(recomp): include <cstdint> before elfio in elf_parser.h - #199
Merged
Conversation
Owner
|
Can you remove the comments the pr description is enough |
ELFIO, pinned at Release_3.12 via FetchContent, uses uint16_t, uint32_t
and uint64_t in elf_types.hpp without including <cstdint> itself. Newer
libstdc++ releases trimmed the transitive includes that used to supply
those typedefs, so building elf_parser.cpp fails:
elf_types.hpp:30:20: error: 'uint16_t' does not name a type
30 | using Elf_Half = uint16_t;
Include <cstdint> ahead of elfio.hpp so the typedefs are visible when
that header is processed. Header-only change; no behaviour is affected.
smmathews
force-pushed
the
fix/elfio-cstdint
branch
from
August 1, 2026 15:37
e435e55 to
56d1c02
Compare
Contributor
Author
|
Done — comment removed, the include is now the whole change. |
smmathews
marked this pull request as ready for review
August 1, 2026 15:38
Owner
|
Thanks we can do like that we can discuss on the pr and change infos and put less comments on codem |
This was referenced Aug 1, 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.
Problem
ps2xRecomp/include/ps2recomp/elf_parser.hincludes<elfio/elfio.hpp>withoutfirst including
<cstdint>. ELFIO — pinned atRelease_3.12via FetchContent inps2xRecomp/CMakeLists.txt— usesuint16_t,uint32_tanduint64_tinelf_types.hppwithout including<cstdint>itself. Newer libstdc++ releasestrimmed the transitive includes that used to supply those typedefs, so a clean
build of
mainfails on a current toolchain:Fix
Include
<cstdint>immediately before<elfio/elfio.hpp>, with a commentrecording why the order matters. Header-only; no behaviour changes.
Testing
Reproduced both directions on a clean checkout, GCC 16.1.1:
Without the change the target fails with the error above; with it the target
builds and links.
Risk and not in scope
The include is unconditional and costs nothing on toolchains that still pull the
typedefs in transitively. Bumping the ELFIO pin, or reporting the missing include
upstream to ELFIO, would also fix it — neither is attempted here.
Seven open branches of mine carry this same one-line fix as a passenger, because
none of them could be built without it: #137, #150, #151, #152, #154, #156 and
#157. None of their descriptions mentions it, so a reviewer of any one of them
meets an unexplained header change. If this lands first they all drop it on
rebase; whichever order they merge in, the duplicate is a trivial conflict rather
than a behavioural one.