Merge "Suppress -Wformat warning"

This commit is contained in:
Treehugger Robot 2022-03-16 18:55:05 +00:00 committed by Gerrit Code Review
commit 8321ff1468

View file

@ -364,10 +364,13 @@ TEST(STDIO_TEST, snprintf_S) { // Synonym for %ls.
TEST_F(STDIO_DEATHTEST, snprintf_n) {
#if defined(__BIONIC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
// http://b/14492135 and http://b/31832608.
char buf[32];
int i = 1234;
EXPECT_DEATH(snprintf(buf, sizeof(buf), "a %n b", &i), "%n not allowed on Android");
#pragma GCC diagnostic pop
#else
GTEST_SKIP() << "glibc does allow %n";
#endif