Skip to content

Conversation

bogner
Copy link
Collaborator

@bogner bogner commented Sep 4, 2025

Newer versions of clang include -Wcast-function-type-mismatch in -Wextra, which triggers a warning when we cast between function pointers that differ between a pointer and a reference in an argument. Resolve these issues the same way that upstream did.

There are two changes here, equivalent to the following changes upstream:

Newer versions of clang include -Wcast-function-type-mismatch in
-Wextra, which triggers a warning when we cast between function pointers
that differ between a pointer and a reference in an argument. Resolve
this by making the types consistent.

This change is equivalent to llvm/llvm-project#86504 from upstream.
Copy link
Contributor

@tex3d tex3d left a comment

Choose a reason for hiding this comment

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

LGTM!

@bogner
Copy link
Collaborator Author

bogner commented Sep 4, 2025

Might need to Needed to cherry pick llvm/llvm-project@86f8b70 as well to resolve more of these cast warnings

Copy link
Contributor

github-actions bot commented Sep 4, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@bogner bogner changed the title Change type of DiagnosticHandlerTy Integrate upstream changes for -Wcast-function-type-mismatch Sep 4, 2025
@bogner bogner force-pushed the 2025-09-diagnostichandlerty branch from f2b7a17 to 658bd2d Compare September 4, 2025 04:00
Previous version used type erasure through a `void* (*)()` pointer,
which triggered gcc warning and implied a lot of reinterpret_cast.

This version should make it harder to hit ourselves in the foot.

Differential revision: https://reviews.llvm.org/D54203

(cherry picked from commit 86f8b70f1b7c3f92266197d580f6d86414650997)
@bogner bogner force-pushed the 2025-09-diagnostichandlerty branch from 658bd2d to 4ddee81 Compare September 4, 2025 04:12
Copy link
Collaborator

@bob80905 bob80905 left a comment

Choose a reason for hiding this comment

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

LGTMUE

@bogner bogner merged commit 4ddee81 into microsoft:main Sep 4, 2025
12 checks passed
@github-project-automation github-project-automation bot moved this from New to Done in HLSL Roadmap Sep 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants