summaryrefslogtreecommitdiffstats
path: root/testutil/is-datatype-struct.c
diff options
context:
space:
mode:
Diffstat (limited to 'testutil/is-datatype-struct.c')
-rw-r--r--testutil/is-datatype-struct.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/testutil/is-datatype-struct.c b/testutil/is-datatype-struct.c
index f1c7675..e9eb2ef 100644
--- a/testutil/is-datatype-struct.c
+++ b/testutil/is-datatype-struct.c
@@ -6,18 +6,29 @@
#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_os)atoi(argv[1]);
- enum libsyscalls_arch arch = (enum libsyscalls_arch)atoi(argv[2]);
- enum libsyscalls_datatype type = (enum libsyscalls_datatype)atoi(argv[3]);
+ int os, arch, type;
struct libsyscalls_datatype_description desc;
enum libsyscalls_error err;
- size_t i;
- err = libsyscalls_get_datatype_description(os, arch, type, &desc);
+ if (argc != 7) {
+ fprintf(stderr, "usage error\n");
+ return 3;
+ }
+
+ os = atoi(argv[1]);
+ arch = atoi(argv[2]);
+ type = atoi(argv[3]);
+
+ err = libsyscalls_get_datatype_description((enum libsyscalls_os)os, (enum libsyscalls_arch)arch,
+ (enum libsyscalls_datatype)type, &desc);
if (err == LIBSYSCALLS_E_ISSTRUCT) {
return 0;
} else if (err) {