clang -cc1 -cc1 -triple amd64-unknown-openbsd7.0 -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name conftest.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 1 -pic-is-pie -mframe-pointer=all -relaxed-aliasing -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-feature +retpoline-indirect-calls -target-feature +retpoline-indirect-branches -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/usr/src/gnu/usr.bin/binutils/obj/gdb -resource-dir /usr/local/lib/clang/13.0.0 -D PIE_DEFAULT=1 -internal-isystem /usr/local/lib/clang/13.0.0/include -internal-externc-isystem /usr/include -O2 -fdebug-compilation-dir=/usr/src/gnu/usr.bin/binutils/obj/gdb -ferror-limit 19 -fwrapv -D_RET_PROTECTOR -ret-protector -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-valloc -fno-builtin-free -fno-builtin-strdup -fno-builtin-strndup -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /home/ben/Projects/vmm/scan-build/2022-01-12-194120-40624-1 -x c conftest.c
1 | #line 6483 "configure" |
2 | #include "confdefs.h" |
3 | |
4 | #include <stdio.h> |
5 | #include <sys/types.h> |
6 | #include <sys/stat.h> |
7 | #ifdef HAVE_UNISTD_H |
8 | #include <unistd.h> |
9 | #endif |
10 | #ifdef HAVE_VFORK_H |
11 | #include <vfork.h> |
12 | #endif |
13 | |
14 | |
15 | |
16 | |
17 | |
18 | |
19 | static |
20 | #ifdef __cplusplus |
21 | sparc_address_test (int arg) |
22 | #else |
23 | sparc_address_test (arg) int arg; |
24 | #endif |
25 | { |
26 | static pid_t child; |
27 | if (!child) { |
| |
28 | child = vfork (); |
29 | if (child < 0) { |
| |
30 | perror ("vfork"); |
31 | _exit(2); |
32 | } |
33 | if (!child) { |
| |
34 | arg = getpid(); |
| 4 | | This function call is prohibited after a successful vfork |
|
35 | write(-1, "", 0); |
36 | _exit (arg); |
37 | } |
38 | } |
39 | } |
40 | main() { |
41 | pid_t parent = getpid (); |
42 | pid_t child; |
43 | |
44 | sparc_address_test (); |
45 | |
46 | child = vfork (); |
47 | |
48 | if (child == 0) { |
49 | |
50 | |
51 | |
52 | |
53 | |
54 | |
55 | |
56 | |
57 | |
58 | |
59 | pid_t |
60 | p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), |
61 | p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); |
62 | |
63 | |
64 | if (p != p1 || p != p2 || p != p3 || p != p4 |
65 | || p != p5 || p != p6 || p != p7) |
66 | _exit(1); |
67 | |
68 | |
69 | |
70 | |
71 | |
72 | |
73 | _exit(close(fileno(stdout)) != 0); |
74 | } else { |
75 | int status; |
76 | struct stat st; |
77 | |
78 | while (wait(&status) != child) |
79 | ; |
80 | exit( |
81 | |
82 | child < 0 |
83 | |
84 | |
85 | || status |
86 | |
87 | |
88 | || parent != getpid() |
89 | |
90 | |
91 | || fstat(fileno(stdout), &st) != 0 |
92 | ); |
93 | } |
94 | } |