fix: clear GCC warnings in the AGC driver and two tests #7555
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7555"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-18T13:48:10Z.
What
A clean Release build (
CMAKE_BUILD_TYPE=Release,BUILD_TESTING=ON) with GCC warns in these five places incore/. Each is fixed without changing behaviour: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.libSceAgcDriver/Execution/src/Driver/Packets/CommandValidation.cpp(second commit): "unsupported PM4 packet type: header 0x%08x at DWORD %zu of %zu" needs up to 101 bytes for the largest%zuvalues and had 96 (-Wformat-truncation). The buffer is 128 bytes.libSceAgcDriver/Graphics/src/State.cpp(second commit): the stencil operation message needs up to 119 bytes for a 10-digit%uand had 112 (-Wformat-truncation). The operation is at most 15, so the text always fit; 128 bytes only silences the warning. #6762, which changed that buffer, has merged.Not in this PR any more: this PR also fixed
chdir's deprecatedstd::filesystem::u8pathin libc and the null%sargument insceKernelOpen's log. Both functions now copy the guest path first (2c5fcf6406, "safely copy guest path arguments"), somainno longer warns there, and the rebase dropped those hunks.Also not in this PR:
DepthSurface.cpp's tile mode format (#7504) andStagedClearSampledRead.cpp's%u(#7415) are open as their own PRs.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
main316615d042(head9db070f8de, two commits).SubmissionCapture.cppconflicted with #10307's queue range change: the merge keepsmain'sDriverDetail::SubmissionQueueEndbound and this PR's 96-byte buffer. Ubuntu 26.04.1, GCC 15.2, Release. The rebased first commit (9aaf5ee0bf) recompiled its three files without their warnings; that build's log still showed the two the second commit fixes andDepthSurface.cpp:1305, which is #7504's. At this head, the two files the second commit changes recompile without a warning.agc_driver_graphics,agc_constant_phi,guest_memoryandagc_driver_pm4pass 3 of 3. Windows 11 VM (GT 1030, WinLibs GCC 15.2.0, Release): the base316615d042and this head both build, and the four tests pass 3 of 3 on each; the rebased first commit alone (9aaf5ee0bf) passes its three 3 of 3 too.Earlier:
Rebased onto
main6f58a046b1(head7e7b5ca3a7, one commit), on Ubuntu 26.04.1, GCC 15.2, Release. I touched the three files and built their targets onmainand on this head. Onmain, all three warnings appear:SubmissionCapture.cpp:179-Wformat-truncationConstantPhi.cpp:177ignored[[nodiscard]]GuestMemoryModule.cpp:1"initialized and declared 'extern'"On this head none appear.
agc_driver_graphics,agc_constant_phiandguest_memorypass.Windows 11 VM (GT 1030, 582.78, WinLibs GCC 15.2.0): both the merge base
acbfd7c7feand this head build. The same three tests pass 3 of 3 on each.Windows: @brummilab confirmed the
ConstantPhi.cpp:177-Wunused-resultwarning this fixes, with WinLibs GCC 15.2.0 r7 onmain2fade7ef4.Earlier, on the five-file head
2368d21ba0, Ubuntu 24.04 (Linux 6.8), GCC 13.3, NVIDIA RTX 4070 Ti, driver 595.99.02:main5bf2e139efwith 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: #5021, #6044, #6222 and #6879. Of those, #6044, #6222 and #6879 don't touch these lines; #5021's diff is too large for the API.VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest -R '^agc_' -Vonmainf29546ac4eand onmain+ this PR (2368d21ba0, a local merge).main: 812 of 812 pass; with this PR: 812 of 812 pass. Neither log reports the layer missing. VUIDs onmain:VUID-VkImageViewCreateInfo-usage-02275×6,VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605×18,VUID-vkCmdCopyBuffer-srcBuffer-00118×2,VUID-vkCmdDispatch-magFilter-04553×2,VUID-vkCmdDraw-multisampledRenderToSingleSampled-07285×2,VUID-vkCmdWaitEvents-srcStageMask-01158×2,VUID-vkSetEvent-event-09543×2; with this PR:VUID-VkImageViewCreateInfo-usage-02275×6,VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605×18,VUID-vkCmdCopyBuffer-srcBuffer-00118×2,VUID-vkCmdDispatch-magFilter-04553×2,VUID-vkCmdDraw-multisampledRenderToSingleSampled-07285×2,VUID-vkCmdWaitEvents-srcStageMask-01158×2,VUID-vkSetEvent-event-09543×2. None is new with this PR. Each ofmain's is the subject of an open PR: 00118 #7961, 04553 #7707, 07285 #7985, 01158 and 09543 #7913, 00605 #6782, 02275 #862.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
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T13:54:30Z.
Review: APPROVED
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.