We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5088795 commit 5953e07Copy full SHA for 5953e07
compiler-rt/lib/asan/tests/asan_test.cpp
@@ -395,10 +395,8 @@ TEST(AddressSanitizer, ReallocTest) {
395
}
396
free(ptr);
397
// Realloc pointer returned by malloc(0).
398
-#pragma clang diagnostic push
399
-#pragma clang diagnostic ignored "-Walloc-size"
400
- int *ptr2 = Ident((int*)malloc(0));
401
-#pragma clang diagnostic pop
+ volatile void *ptr0 = malloc(0);
+ int *ptr2 = Ident((int *)ptr0);
402
ptr2 = Ident((int*)realloc(ptr2, sizeof(*ptr2)));
403
*ptr2 = 42;
404
EXPECT_EQ(42, *ptr2);
0 commit comments