Enable -Wextra in tests.
This commit is contained in:
+9
-3
@@ -10,9 +10,15 @@ int main(void) {
|
||||
|
||||
char buf[33] = { 0 };
|
||||
for (int i = 1; i <= 32; ++i) {
|
||||
if (fread(buf, 1, i, fp) < 0) {
|
||||
perror("fread");
|
||||
exit(EXIT_FAILURE);
|
||||
size_t nread = fread(buf, 1, i, fp);
|
||||
if (nread == 0) {
|
||||
if (feof(fp)) {
|
||||
fprintf(stderr, "early EOF\n");
|
||||
return EXIT_FAILURE;
|
||||
} else {
|
||||
perror("fread");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
buf[i] = 0;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <assert.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <wchar.h>
|
||||
|
||||
@@ -32,7 +33,7 @@ int main(void) {
|
||||
&test_reopen_opens_file,
|
||||
&test_reopen_resets_orientation,
|
||||
};
|
||||
for(int i=0; i<sizeof(tests)/sizeof(int(*)(void)); i++) {
|
||||
for(size_t i = 0; i < sizeof(tests) / sizeof(int(*)(void)); i++) {
|
||||
printf("%d\n", (*tests[i])());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user