summaryrefslogtreecommitdiffstats
path: root/testutil/is-section-quarter.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-12-05 20:10:48 +0100
committerMattias Andrée <maandree@kth.se>2023-12-05 20:10:48 +0100
commit6d77b155bcd4725e09837604e6ea86f5f124ba9c (patch)
tree7cfdf466bb94bbbe3e7929432bc048da5eaa2349 /testutil/is-section-quarter.c
parentSecond commit (diff)
downloadlibsyscalls-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 'testutil/is-section-quarter.c')
-rw-r--r--testutil/is-section-quarter.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/testutil/is-section-quarter.c b/testutil/is-section-quarter.c
index 1fe28d2..fd076f8 100644
--- a/testutil/is-section-quarter.c
+++ b/testutil/is-section-quarter.c
@@ -1,14 +1,24 @@
/* See LICENSE file for copyright and license details. */
#include "../libsyscalls.h"
+#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;
- (void) argc;
- sec = (enum libsyscalls_datatype_section)atoi(argv[1]);
- return !LIBSYSCALLS_IS_SECTION_QUARTER(sec);
+ int sec;
+
+ if (argc != 2) {
+ fprintf(stderr, "usage error\n");
+ return 3;
+ }
+
+ sec = atoi(argv[1]);
+ return !LIBSYSCALLS_IS_SECTION_QUARTER((enum libsyscalls_datatype_section)sec);
}