Skip to content

Commit 0b01b21

Browse files
authored
[LLVMgold] Suppress -Wcast-function-type-mismatch diagnostic
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
1 parent 63ecd2a commit 0b01b21

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm/tools/gold/gold-plugin.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,10 @@ ld_plugin_status onload(ld_plugin_tv *tv) {
434434
// FIXME: When binutils 2.31 (containing gold 1.16) is the minimum
435435
// required version, this should be changed to:
436436
// get_wrap_symbols = tv->tv_u.tv_get_wrap_symbols;
437-
get_wrap_symbols =
438-
(ld_plugin_get_wrap_symbols)tv->tv_u.tv_message;
437+
#pragma GCC diagnostic push
438+
#pragma GCC diagnostic ignored "-Wcast-function-type"
439+
get_wrap_symbols = (ld_plugin_get_wrap_symbols)tv->tv_u.tv_message;
440+
#pragma GCC diagnostic pop
439441
break;
440442
default:
441443
break;

0 commit comments

Comments
 (0)