summaryrefslogtreecommitdiffstats
path: root/testutil/get-syscall-range.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--testutil/get-syscall-range.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/testutil/get-syscall-range.c b/testutil/get-syscall-range.c
index 9f26b8e..2c40b71 100644
--- a/testutil/get-syscall-range.c
+++ b/testutil/get-syscall-range.c
@@ -5,21 +5,27 @@
#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;
long long int min, max;
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]);
- err = libsyscalls_get_syscall_range(os, arch, &min, &max);
+ err = libsyscalls_get_syscall_range((enum libsyscalls_os)os, (enum libsyscalls_arch)arch, &min, &max);
if (err == LIBSYSCALLS_E_OSNOSUP || err == LIBSYSCALLS_E_ARCHNOSUP) {
printf("min: x\n");
printf("max: x\n");