Repository navigation
fix: clear GCC warnings in libc, libkernel, the AGC driver and two tests - #7555
Open
milescoviello wants to merge 1 commit into
Open
milescoviello wants to merge 1 commit into
milescoviello wants to merge 1 commit into
Conversation
A Release build with GCC 13.3 warned in these five places: - General.cpp built chdir's path with std::filesystem::u8path, which is deprecated in C++20. It uses the char8_t path constructor, as the other UTF-8 paths in libc and libkernel do. - sceKernelOpen logged its path with %s before rejecting a null path, and passing a null pointer to %s is undefined. The log shows "(null)" for it. - SubmissionCapture's unknown-queue message needs up to 67 bytes and was formatted into 64, so queue numbers above 0xfffff lost its end. The buffer is 96 bytes. - ConstantPhi.cpp ignored IrBuilder::Emit's nodiscard result. - GuestMemoryModule.cpp both initialized and declared guestMemoryModuleData extern. The definition is now inside an extern "C" block. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MarcZX10
approved these changes
Oct 18, 2026
MarcZX10
left a comment
Contributor
There was a problem hiding this comment.
Reviewed the five warning fixes against their call sites and existing UTF-8 path construction. The null-path log now avoids passing a null pointer to %s; the larger queue message buffer accommodates the full formatted diagnostic; and the ignored nodiscard result and C-linkage definition changes are appropriate. The focused hosted checks and cross-platform relinker/context jobs pass. I did not rerun the full build locally.
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
This branch has not been deployed
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.
What
A clean Release build (
CMAKE_BUILD_TYPE=Release,BUILD_TESTING=ON) with GCC 13.3 warns in these five places incore/. Each is fixed without changing behaviour, except the null log argument, which was undefined:libc/src/General.cpp(chdir):std::filesystem::u8pathis deprecated in C++20. The path is now built with thechar8_tconstructor, asOpenInDirectory_nid_no_patchand the other UTF-8 paths in libc and libkernel already do. Both read the string as UTF-8.libkernel/File/src/Open.cpp(sceKernelOpen): the log line formatspathwith%sbefore anything rejects a null path. Passing a null pointer to%sis undefined (GCC: "'%s' directive argument is null"). The log now shows(null)for it; the call's result doesn't change.libSceAgcDriver/Execution/src/SubmissionCapture.cpp(QueueType): "queue 0x%x is neither the graphics queue nor a compute queue" needs up to 67 bytes, and it was formatted into 64. So for a queue number above 0xfffff, the end of the exception message was cut off. The buffer is now 96 bytes.libSceAgcDriver/tests/ConstantPhi.cpp: the result of a[[nodiscard]]IrBuilder::Emitwas ignored. It is nowstatic_cast<void>, as the other tests do.tests/GuestMemoryModule.cpp:guestMemoryModuleDatawas both initialized and declaredextern("initialized and declared 'extern'"). The definition is now inside anextern "C" { }block, which gives the same C linkage and external symbol.Not in this PR:
DepthSurface.cpp's tile mode format (fix(agc): pass the tile mode of a mismatched depth plane copy as an int #7504) andStagedClearSampledRead.cpp's%u(test(agc): print the staged clear's expected byte count as a size_t #7415) are open as their own PRs.State.cppalso warns (-Wformat-truncation). Its values are bytes, so it fits; I left it alone because fix(agc): replace with a stencil operation value the pixel shader exports #6762 changes that buffer.sceRtcFormatRFC2822formats into the guest's 32-byte buffer, which its longest valid string exactly fills, so that warning is a false positive I can't fix by enlarging anything.stl_algobase.h(GCC 13-Wstringop-overflow/-Warray-boundsfalse positives on vector copies) or in glslang.Tested
Ubuntu 24.04 (Linux 6.8), GCC 13.3, NVIDIA RTX 4070 Ti, driver 595.99.02.
main5bf2e13 with this PR: none of the five warnings above appear.ctest -R "^guest_|constant_phi|submission|stencil|graphics|libc": 436/436 pass.tools/check_conventions.py --base upstream/mainpasses.tools/pr_overlap.pylists only conflicting PRs that it could not compare: feat(aot): consolidate native ARM64 compiler, runtime and consumers #5021, test: organize library tests and label CTest suites #6044, Macos m4 #6222 and feat(wasm): run relinked titles in the browser with WebGPU #6879. Of those, test: organize library tests and label CTest suites #6044, Macos m4 #6222 and feat(wasm): run relinked titles in the browser with WebGPU #6879 don't touch these lines; feat(aot): consolidate native ARM64 compiler, runtime and consumers #5021's diff is too large for the API.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code