3 #include <libc-internal.h>
6 main(int arc
, char *argv
[])
11 FILE *fp
= fopen ("/dev/null", "r");
14 res
= fscanf(fp
, "%n", &val
);
16 printf("Result of fscanf %%n = %d\n", res
);
17 printf("Scanned format = %d\n", val
);
19 /* We're testing exactly the case the warning is for. */
20 DIAG_PUSH_NEEDS_COMMENT
;
21 DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wformat-zero-length");
25 DIAG_POP_NEEDS_COMMENT
;
27 printf("Result of fscanf \"\" = %d\n", res
);
31 res
= fscanf(fp
, "BLURB");
32 printf("Result of fscanf \"BLURB\" = %d\n", res
);