Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Clang] -Wpsabi complains too eagerly #128361

Open
philnik777 opened this issue Feb 22, 2025 · 0 comments
Open

[Clang] -Wpsabi complains too eagerly #128361

philnik777 opened this issue Feb 22, 2025 · 0 comments
Labels
clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer

Comments

@philnik777
Copy link
Contributor

Clang currently complains when calling a function that the ABI changes if a feature is enabled, but ignores that the function is marked [[gnu::always_inline]], which ensures that the type will never be part of the ABI. e.g.

using vec [[gnu::vector_size(32)]] = int;

[[gnu::always_inline]] vec test() {
  return {};
}

void call() {
  (void)test(); // complains that test() changes the ABI with avx enabled
}

Ironically, it doesn't complain if the address is taken, which is one of the few cases where this would actually matter, since LLVM might not be able to inline a call to the function pointer.

@philnik777 philnik777 added the clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer label Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer
Projects
None yet
Development

No branches or pull requests

1 participant