Skip to content

fix: clear GCC warnings in libc, libkernel, the AGC driver and two tests - #7555

Open
milescoviello wants to merge 1 commit into
boykopovar:mainfrom
milescoviello:fix/gcc-warnings-libs
Open

milescoviello wants to merge 1 commit into
boykopovar:mainfrom
milescoviello:fix/gcc-warnings-libs

Conversation

@milescoviello

Copy link
Copy Markdown
Contributor

What

A clean Release build (CMAKE_BUILD_TYPE=Release, BUILD_TESTING=ON) with GCC 13.3 warns in these five places in core/. Each is fixed without changing behaviour, except the null log argument, which was undefined:

  • libc/src/General.cpp (chdir): std::filesystem::u8path is deprecated in C++20. The path is now built with the char8_t constructor, as OpenInDirectory_nid_no_patch and 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 formats path with %s before anything rejects a null path. Passing a null pointer to %s is 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::Emit was ignored. It is now static_cast<void>, as the other tests do.
  • tests/GuestMemoryModule.cpp: guestMemoryModuleData was both initialized and declared extern ("initialized and declared 'extern'"). The definition is now inside an extern "C" { } block, which gives the same C linkage and external symbol.

Not in this PR:

Tested

Ubuntu 24.04 (Linux 6.8), GCC 13.3, NVIDIA RTX 4070 Ti, driver 595.99.02.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 4070 Ti, driver 595.99.02, Ubuntu 24.04 (Linux 6.8)
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

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 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

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.

Pull request Shared files not compared
PR 5021 core/libs/prx/libc/src/General.cpp
core/libs/prx/libkernel/File/src/Open.cpp
PR 6044 core/libs/tests/GuestMemoryModule.cpp
PR 6226 core/libs/prx/libc/src/General.cpp
PR 6879 core/libs/prx/libc/src/General.cpp
PR 6936 core/libs/prx/libkernel/File/src/Open.cpp
PR 6942 core/libs/prx/libkernel/File/src/Open.cpp
PR 7201 core/libs/prx/libc/src/General.cpp
core/libs/prx/libkernel/File/src/Open.cpp
PR 7332 core/libs/prx/libc/src/General.cpp
core/libs/prx/libkernel/File/src/Open.cpp

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants