diff options
author | Mattias Andrée <maandree@kth.se> | 2023-12-05 20:10:48 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2023-12-05 20:10:48 +0100 |
commit | 6d77b155bcd4725e09837604e6ea86f5f124ba9c (patch) | |
tree | 7cfdf466bb94bbbe3e7929432bc048da5eaa2349 /testutil/get-section-fraction.c | |
parent | Second commit (diff) | |
download | libsyscalls-6d77b155bcd4725e09837604e6ea86f5f124ba9c.tar.gz libsyscalls-6d77b155bcd4725e09837604e6ea86f5f124ba9c.tar.bz2 libsyscalls-6d77b155bcd4725e09837604e6ea86f5f124ba9c.tar.xz |
Third commit
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | testutil/get-section-fraction.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/testutil/get-section-fraction.c b/testutil/get-section-fraction.c index cdb1530..2b86206 100644 --- a/testutil/get-section-fraction.c +++ b/testutil/get-section-fraction.c @@ -5,16 +5,23 @@ #include <stdio.h> #include <stdlib.h> +#if defined(__clang__) +# pragma clang diagnostic ignored "-Wunsafe-buffer-usage" /* clang is just being silly */ +#endif + int -main(int argc, char *argv[]) +main(int argc, char **argv) { - enum libsyscalls_datatype_section sec; + int sec; - (void) argc; + if (argc != 2) { + fprintf(stderr, "usage error\n"); + return 3; + } - sec = (enum libsyscalls_datatype_section)atoi(argv[1]); - printf("%u\n", LIBSYSCALLS_GET_SECTION_FRACTION(sec)); + sec = atoi(argv[1]); + printf("%u\n", LIBSYSCALLS_GET_SECTION_FRACTION((enum libsyscalls_datatype_section)sec)); if (fflush(stdout) || fclose(stdout)) { perror(NULL); |