summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Aditya Kumar <appujee@google.com> 2025-02-24 19:30:48 -0800
committer Aditya Kumar <appujee@google.com> 2025-02-25 10:27:36 -0800
commit9aad1508e7907e4503888df63d3659fe27b8244f (patch)
treea8dae407b38e68f787bd8a6a175200712c50a729
parentc15df4f176d4ebf9df86d4d32413b8b531ea6f01 (diff)
Disable -Wcast-function-type-mismatch
Code owners should fix this. ``` ...ka 'int (*)(long, long, long *, int, void *)') to 'ArtExtensionAPI' (aka 'int (*)(long, long, long *, int, void *, int)') converts to incompatible function type [-Werror,-Wcast-function-type-mismatch] 1606 | return reinterpret_cast<ArtExtensionAPI>(cb_callbacks->heap_iteration_callback)( | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` Bug: b/353528991 Test: m checkbuild Change-Id: I5f95a74baebe8d78ff1618bd22e1f8943018be6e
-rw-r--r--openjdkjvmti/ti_heap.cc3
-rw-r--r--test/913-heaps/heaps.cc3
2 files changed, 6 insertions, 0 deletions
diff --git a/openjdkjvmti/ti_heap.cc b/openjdkjvmti/ti_heap.cc
index af74b67b17..49a6748c28 100644
--- a/openjdkjvmti/ti_heap.cc
+++ b/openjdkjvmti/ti_heap.cc
@@ -1583,6 +1583,8 @@ jvmtiError HeapExtensions::GetHeapName(jvmtiEnv* env, jint heap_id, char** heap_
}
}
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wcast-function-type-mismatch"
jvmtiError HeapExtensions::IterateThroughHeapExt(jvmtiEnv* env,
jint heap_filter,
jclass klass,
@@ -1614,6 +1616,7 @@ jvmtiError HeapExtensions::IterateThroughHeapExt(jvmtiEnv* env,
callbacks,
user_data);
}
+#pragma clang diagnostic pop
namespace {
diff --git a/test/913-heaps/heaps.cc b/test/913-heaps/heaps.cc
index 197230f01e..e857c4b57c 100644
--- a/test/913-heaps/heaps.cc
+++ b/test/913-heaps/heaps.cc
@@ -1119,6 +1119,8 @@ static jint JNICALL HeapIterationExtCallback([[maybe_unused]] jlong class_tag,
return 0;
}
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wcast-function-type-mismatch"
extern "C" JNIEXPORT void JNICALL Java_art_Test913_iterateThroughHeapExt(
JNIEnv* env, [[maybe_unused]] jclass klass) {
CHECK(gIterateThroughHeapExt != nullptr);
@@ -1132,6 +1134,7 @@ extern "C" JNIEXPORT void JNICALL Java_art_Test913_iterateThroughHeapExt(
JvmtiErrorToException(env, jvmti_env, ret);
CHECK(gFoundExt);
}
+#pragma clang diagnostic pop
extern "C" JNIEXPORT jboolean JNICALL Java_art_Test913_checkInitialized(JNIEnv* env, jclass, jclass c) {
jint status;