fix: clear the GCC warnings in ProfileOutput, fopen, Ajm batch jobs and the SHA-256 test #1549
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1549"
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 LeandroLP23 on 2026-10-08T11:58:29Z.
What
Clears 21 of the 39 GCC warnings in the Linux CI build and 5 of the 8 in the Windows one. All of them come from code in this repository;
3rdpartyis left alone.ProfileOutput.hpp(-Wformat-security, 20 on Linux):ProfilePrint_nid_no_patch("[guestmem]")and the other calls without arguments inGuestMemory.cppandRecorder.cppreachedsnprintfwith a non-literal format. APrint(const char*)overload sends that text through"%s". None of these strings contains%, so the output is unchanged.FileAndHeap.cpp(-Wignored-attributes, 1 on Linux):decltype(&std::fclose)carries glibc's attributes into theunique_ptrdeleter type; the deleter is nowint (*)(std::FILE*).Ajm.cpp(-Wnonnull, 13 on Linux):Appendis inlined into the batch-job functions that passnullptrbuffers, and the fortifiedmemcpywarned about them.Appendnow throws (NotImplemented_nid_no_patch) when a buffer list is null and its count is not zero, since the console's result there is unknown, and copies only when the pointer is set.sceAjmBatchJobRunSplitwithnullptrinputs and a count of 1 used to crash inmemcpy;GuestAjm.cppchecks that it now throws and leaves the batch untouched.Amd64OnlyWindowsTests.cpp(-Wstringop-overflow, 5 on Windows): a GCC false positive onstd::vector<Sha256Step>(n)for the 3-byte struct; passingSha256Step{}as the value removes it. The vector is still zero-filled and the sequence ofrandom()calls is the same.Left as is:
sceRtcFormatRFC2822(-Wformat-truncation): the 32-byte buffer is the API's, and the console's behaviour for years past 9999 is unknown.LookBackScan.cpp(-Wstringop-overflow/-Warray-boundsfromstd::vector::insert, Linux only), a GCC false positive in a test.GuestKernelSync.cpp(NOMINMAXredefined, Windows), new inbb1a4cbe.3rdparty/glslang.Tested
Windows 11, MinGW-w64 GCC 15.2.0 (WinLibs r7), Release with
BUILD_TESTING=ON. No title or homebrew.guest_ajm,agc_profile_output,file_position,guest_filesystem,guest_file_vector,guest_host_libc,guest_standard_streams,savedata_replace_file_failure,amd64_only_windows,amd64_only_converter: pass, 3/3 runs each.Appendcheck removed, the newguest_ajmcase crashes (SegFault); with it, it passes. After the review, the check throws instead of returningSCE_AJM_ERROR_INVALID_PARAMETER;guest_ajmpasses.Buildworkflow on my fork: Linux 39 → 5 warnings, 442/442 tests passed; Windows 8 → 3 plus the newNOMINMAXone, 437/437 passed (run).ProfileOutput.hpp), merges that file cleanly with this change.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-08T12:54:19Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libc/src/FileAndHeap.cppL82Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T09:22:17Z.
Ajm.cppAppend: please throw for a null buffer list with a nonzero count instead of returningSCE_AJM_ERROR_INVALID_PARAMETER, since we don't know what the console returns there. The other warning fixes are fine.Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-09T09:27:19Z.
Done in c3735921:
Appendnow throws (NotImplemented_nid_no_patch) for a null buffer list with a nonzero count, andguest_ajmchecks that it throws and leaves the batch untouched.