diff options
Diffstat (limited to 'testutil/get-syscall-errors.c')
-rw-r--r-- | testutil/get-syscall-errors.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/testutil/get-syscall-errors.c b/testutil/get-syscall-errors.c index c97e556..d1ddfd7 100644 --- a/testutil/get-syscall-errors.c +++ b/testutil/get-syscall-errors.c @@ -5,22 +5,28 @@ #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_os os; - enum libsyscalls_arch arch; + int os, arch; const struct libsyscalls_named_number *errors; size_t i, nerrors; enum libsyscalls_error err; - (void) argc; + if (argc != 5) { + fprintf(stderr, "usage error\n"); + return 3; + } - os = (enum libsyscalls_os)atoi(argv[1]); - arch = (enum libsyscalls_arch)atoi(argv[2]); + os = atoi(argv[1]); + arch = atoi(argv[2]); - libsyscalls_get_syscall_errors(os, arch, &errors, &nerrors); + err = libsyscalls_get_syscall_errors((enum libsyscalls_os)os, (enum libsyscalls_arch)arch, &errors, &nerrors); if (err == LIBSYSCALLS_E_OSNOSUP || err == LIBSYSCALLS_E_ARCHNOSUP) { printf("x\n"); return 0; |