Merge "Fix clang warnings in bionic."

This commit is contained in:
Stephen Hines 2013-10-11 23:27:40 +00:00 committed by Gerrit Code Review
commit 8704ada3d8
3 changed files with 6 additions and 6 deletions

View file

@ -53,10 +53,10 @@ TEST(libc_logging, smoke) {
__libc_format_buffer(buf, sizeof(buf), "a%db", -8123);
EXPECT_STREQ("a-8123b", buf);
__libc_format_buffer(buf, sizeof(buf), "a%hdb", 0x7fff0010);
__libc_format_buffer(buf, sizeof(buf), "a%hdb", static_cast<short>(0x7fff0010));
EXPECT_STREQ("a16b", buf);
__libc_format_buffer(buf, sizeof(buf), "a%hhdb", 0x7fffff10);
__libc_format_buffer(buf, sizeof(buf), "a%hhdb", static_cast<char>(0x7fffff10));
EXPECT_STREQ("a16b", buf);
__libc_format_buffer(buf, sizeof(buf), "a%lldb", 0x1000000000LL);

View file

@ -48,7 +48,7 @@ static void noinline do_crash() {
}
static void noinline foo() {
char c1 __attribute__((cleanup(foo_cleanup)));
char c1 __attribute__((cleanup(foo_cleanup))) unused;
do_crash();
}

View file

@ -226,10 +226,10 @@ TEST(stdio, snprintf_smoke) {
snprintf(buf, sizeof(buf), "a%db", -8123);
EXPECT_STREQ("a-8123b", buf);
snprintf(buf, sizeof(buf), "a%hdb", 0x7fff0010);
snprintf(buf, sizeof(buf), "a%hdb", static_cast<short>(0x7fff0010));
EXPECT_STREQ("a16b", buf);
snprintf(buf, sizeof(buf), "a%hhdb", 0x7fffff10);
snprintf(buf, sizeof(buf), "a%hhdb", static_cast<char>(0x7fffff10));
EXPECT_STREQ("a16b", buf);
snprintf(buf, sizeof(buf), "a%lldb", 0x1000000000LL);
@ -281,7 +281,7 @@ TEST(stdio, snprintf_smoke) {
snprintf(buf, sizeof(buf), "a_%f_b", 1.23f);
EXPECT_STREQ("a_1.230000_b", buf);
snprintf(buf, sizeof(buf), "a_%g_b", 3.14d);
snprintf(buf, sizeof(buf), "a_%g_b", 3.14);
EXPECT_STREQ("a_3.14_b", buf);
}