add -Wpedantic to default CFLAGS
[baseutils.git] / arch.c
1 /*
2 * This is free and unencumbered software released into the public domain.
3 *
4 * Anyone is free to copy, modify, publish, use, compile, sell, or
5 * distribute this software, either in source code form or as a compiled
6 * binary, for any purpose, commercial or non-commercial, and by any
7 * means.
8 *
9 * In jurisdictions that recognize copyright laws, the author or authors
10 * of this software dedicate any and all copyright interest in the
11 * software to the public domain. We make this dedication for the benefit
12 * of the public at large and to the detriment of our heirs and
13 * successors. We intend this dedication to be an overt act of
14 * relinquishment in perpetuity of all present and future rights to this
15 * software under copyright law.
16
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
24 *
25 * For more information, please refer to <https://unlicense.org>
26 */
27
28 #define _XOPEN_SOURCE 700
29
30 #include <sys/utsname.h>
31
32 #include <errno.h>
33 #include <stdio.h>
34 #include <string.h>
35
36 int
37 main(int argc, char *argv[])
38 {
39 (void)argc;
40 struct utsname system_info;
41
42 if (uname(&system_info) != 0) {
43 fprintf(stderr, "%s: uname: %s\n", argv[0], strerror(errno));
44 return 1;
45 }
46
47 printf("%s\n", system_info.machine);
48
49 return 0;
50 }