fix(tests): keep generic category vtable entries castable to functions #6969
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6969"
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 jotitadev on 2026-10-16T22:54:20Z.
What
The
guest_generic_categorytest from #5102 reads the category's vtable asconst void* const*andreinterpret_casts the entries to function pointers. Clang rejects that (reinterpret_cast from 'const void *' to 'Name' ... casts away qualifiers), so the test does not compile on macOS. The vtable entries are nowvoid*, keeping the table itselfconst. GCC builds the same code as before.Reported in #1 (https://github.com/boykopovar/AnyPS5/issues/1#issuecomment-6178527997). @mugurc asked for it as a separate PR (https://github.com/boykopovar/AnyPS5/issues/1#issuecomment-6180063305).
Tested
macOS 27.2 on an Apple M2 Max, Xcode 27.0 (Apple clang 21.0.0, libc++), x86-64 full build configured as
docs/dev/BUILD.mddescribes (cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON). Base:main4808d9c20. I ran the file's exact command fromninja -t commandswith-fsyntax-only. Rechecked after rebasing ontomainab9a47684, with the same flags and-fsyntax-onlyfor-arch x86_64and-arch arm64: the same errors onmain, none on this branch. Results:main: threecasts away qualifierserrors (lines 56 to 58).Not run: the test links against
libc, which does not link on macOS yet. The change only affects the type of a test-local struct field, so Linux and Windows run the same test.Rechecked after rebasing onto
main44df21632(2026-10-15), same flags,-fsyntax-onlyfor-arch x86_64and-arch arm64: the error is still there onmain, and this branch compiles.Overlap: #6222 ("Macos m4", currently conflicting with
main) carries the same one-line change inside a larger macOS series. This is the standalone version @mugurc asked for; whichever lands first, the other only drops this hunk.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 github-actions[bot] on 2026-10-16T23:09:41Z.
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.
core/libs/tests/GuestGenericCategory.cppcore/libs/tests/GuestGenericCategory.cppImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T15:14:10Z.
Checked the change: the vtable field is only used through
reinterpret_castto function pointers (Name,Message,Condition), so dropping theconston the pointee type is behaviour-neutral on GCC/MinGW and fixes the Clang cast error; the table itself staysconst. Conventions and template are fine; merged.