aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/stdio_test.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/stdio_test.cpp b/tests/stdio_test.cpp
index 70a71fb87..d2311fd54 100644
--- a/tests/stdio_test.cpp
+++ b/tests/stdio_test.cpp
@@ -169,3 +169,12 @@ TEST(stdio, getline_invalid) {
ASSERT_EQ(getline(&buffer, &buffer_length, fp), -1);
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);
+}