static const char chars[] =
"Aąę„”\n루\377";
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wtype-limits"
+
static void test_fgetc(void) {
_cleanup_fclose_ FILE *f = NULL;
char c;
assert_se(safe_fgetc(f, &c) == 1);
assert_se(c == chars[i]);
- /* EOF is -1, and hence we can't push value 255 in this way */
+ /* EOF is -1, and hence we can't push value 255 in this way if char is signed */
assert_se(ungetc(c, f) != EOF || c == EOF);
assert_se(c == EOF || safe_fgetc(f, &c) == 1);
assert_se(c == chars[i]);
assert_se(safe_fgetc(f, &c) == 0);
}
+#pragma GCC diagnostic pop
+
static const char buffer[] =
"Some test data\n"
"루Non-ascii chars: ąę„”\n"