Merge "use architecture-specific ssize_t definition"
This commit is contained in:
commit
ccd403161c
2 changed files with 10 additions and 1 deletions
|
@ -85,7 +85,7 @@ typedef .... pthread_t;
|
||||||
|
|
||||||
#ifndef _SSIZE_T_DEFINED_
|
#ifndef _SSIZE_T_DEFINED_
|
||||||
#define _SSIZE_T_DEFINED_
|
#define _SSIZE_T_DEFINED_
|
||||||
typedef long int ssize_t;
|
typedef __kernel_ssize_t ssize_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef __kernel_suseconds_t suseconds_t;
|
typedef __kernel_suseconds_t suseconds_t;
|
||||||
|
|
|
@ -169,3 +169,12 @@ TEST(stdio, getline_invalid) {
|
||||||
ASSERT_EQ(getline(&buffer, &buffer_length, fp), -1);
|
ASSERT_EQ(getline(&buffer, &buffer_length, fp), -1);
|
||||||
ASSERT_EQ(EBADF, errno);
|
ASSERT_EQ(EBADF, errno);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(stdio, printf_ssize_t) {
|
||||||
|
// We used to have a ssize_t definition that confused 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);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue