Skip to content

Commit 493cb53

Browse files
legendecasV8 LUCI CQ
authored andcommitted
[include] suppress clang cast-function-type-mismatch warning on SetWeak
Suppress clang warning cast-function-type-mismatch in embedder calls to `SetWeak`. Change-Id: I6c4eda1b932199a2ea4947fe851ffdf2ae04ad73 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6689209 Reviewed-by: Camillo Bruni <[email protected]> Commit-Queue: Chengzhong Wu <[email protected]> Cr-Commit-Position: refs/heads/main@{#101186}
1 parent d502f1d commit 493cb53

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

include/v8-persistent-handle.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,16 @@ V8_INLINE void PersistentBase<T>::SetWeak(
488488
#if (__GNUC__ >= 8) && !defined(__clang__)
489489
#pragma GCC diagnostic push
490490
#pragma GCC diagnostic ignored "-Wcast-function-type"
491+
#endif
492+
#if __clang__
493+
#pragma clang diagnostic push
494+
#pragma clang diagnostic ignored "-Wcast-function-type-mismatch"
491495
#endif
492496
api_internal::MakeWeak(this->slot(), parameter,
493497
reinterpret_cast<Callback>(callback), type);
498+
#if __clang__
499+
#pragma clang diagnostic pop
500+
#endif
494501
#if (__GNUC__ >= 8) && !defined(__clang__)
495502
#pragma GCC diagnostic pop
496503
#endif

0 commit comments

Comments
 (0)