Skip to content

Commit

Permalink
[LLVMgold] Suppress -Wcast-function-type-mismatch diagnostic
Browse files Browse the repository at this point in the history
llvm/cmake/modules/HandleLLVMOptions.cmake adds -Wextra.
-Wcast-function-type-mismatch was recently added to -Wextra, leading to
a warning for the `get_wrap_symbols` code (https://reviews.llvm.org/D44235).

Suppress the diagnostic.

Pull Request: #89994
  • Loading branch information
MaskRay authored Apr 25, 2024
1 parent 63ecd2a commit 0b01b21
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions llvm/tools/gold/gold-plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,10 @@ ld_plugin_status onload(ld_plugin_tv *tv) {
// FIXME: When binutils 2.31 (containing gold 1.16) is the minimum
// required version, this should be changed to:
// get_wrap_symbols = tv->tv_u.tv_get_wrap_symbols;
get_wrap_symbols =
(ld_plugin_get_wrap_symbols)tv->tv_u.tv_message;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-function-type"
get_wrap_symbols = (ld_plugin_get_wrap_symbols)tv->tv_u.tv_message;
#pragma GCC diagnostic pop
break;
default:
break;
Expand Down

0 comments on commit 0b01b21

Please sign in to comment.