Skip to content

fix(tests): keep generic category vtable entries castable to functions - #6969

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
jotitadev:fix/macos-generic-category-test-cast
Oct 19, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
jotitadev:fix/macos-generic-category-test-cast

Conversation

@jotitadev

Copy link
Copy Markdown
Contributor

What

The guest_generic_category test from #5102 reads the category's vtable as const void* const* and reinterpret_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 now void*, keeping the table itself const. GCC builds the same code as before.

Reported in #1 (#1 (comment)). @mugurc asked for it as a separate PR (#1 (comment)).

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.md describes (cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON). Base: main 4808d9c. I ran the file's exact command from ninja -t commands with -fsyntax-only. Rechecked after rebasing onto main ab9a476, with the same flags and -fsyntax-only for -arch x86_64 and -arch arm64: the same errors on main, none on this branch. Results:

  • main: three casts away qualifiers errors (lines 56 to 58).
  • This branch: compiles, no warnings.

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 main 44df216 (2026-10-15), same flags, -fsyntax-only for -arch x86_64 and -arch arm64: the error is still there on main, 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

  • 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
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 16, 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 6044 core/libs/tests/GuestGenericCategory.cpp
PR 7201 core/libs/tests/GuestGenericCategory.cpp

ycarogabriel-lgtm added a commit to ycarogabriel-lgtm/AnyPS5 that referenced this pull request Oct 17, 2026
…le to functions (@jotitadev)

Open upstream PR for a test that did not compile with libc++; merged so the fork matches what goes upstream.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ycarogabriel-lgtm added a commit to ycarogabriel-lgtm/AnyPS5 that referenced this pull request Oct 18, 2026
…le to functions (@jotitadev)

Open upstream PR for a test that did not compile with libc++; merged so the fork matches what goes upstream.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the change: the vtable field is only used through reinterpret_cast to function pointers (Name, Message, Condition), so dropping the const on the pointee type is behaviour-neutral on GCC/MinGW and fixes the Clang cast error; the table itself stays const. Conventions and template are fine; merged.

ycarogabriel-lgtm added a commit to ycarogabriel-lgtm/AnyPS5 that referenced this pull request Oct 25, 2026
…le to functions (@jotitadev)

Open upstream PR for a test that did not compile with libc++; merged so the fork matches what goes upstream.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants