Let bionic use the correct definition of ssize_t.

Bug: 8253769
Change-Id: I50c7cc20828fc089b83580e039ce9153a6c5a8cc
This commit is contained in:
Elliott Hughes
2013-03-08 15:28:52 -08:00
parent 809eed1ded
commit b6e22482d4
2 changed files with 4 additions and 12 deletions

View File

@@ -171,19 +171,15 @@ TEST(stdio, getline_invalid) {
}
TEST(stdio, printf_ssize_t) {
#if __BIONIC__
// http://b/8253769
ASSERT_EQ(sizeof(__kernel_ssize_t), sizeof(long int));
ASSERT_EQ(sizeof(ssize_t), sizeof(long int));
#else
// TODO: add a .c file so we can test this for bionic --- our C ssize_t is fine.
// For our 32-bit C++ ABI, we have a ssize_t definition that confuses GCC into saying:
ASSERT_EQ(sizeof(ssize_t), sizeof(size_t));
// For our 32-bit ABI, we had a ssize_t definition that confuses GCC into saying:
// error: format '%zd' expects argument of type 'signed size_t',
// but argument 4 has type 'ssize_t {aka long int}' [-Werror=format]
ssize_t v = 1;
char buf[32];
snprintf(buf, sizeof(buf), "%zd", v);
#endif
}
TEST(stdio, popen) {