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-2.17/obj/ld -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-2.17/obj/ld -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 | |
| 2 | |
| 3 | #define PACKAGE_NAME "" |
| 4 | #define PACKAGE_TARNAME "" |
| 5 | #define PACKAGE_VERSION "" |
| 6 | #define PACKAGE_STRING "" |
| 7 | #define PACKAGE_BUGREPORT "" |
| 8 | #define PACKAGE "ld" |
| 9 | #define VERSION "2.17" |
| 10 | #define STDC_HEADERS 1 |
| 11 | |
| 12 | |
| 13 | int |
| 14 | main () |
| 15 | { |
| 16 | |
| 17 | #ifndef __cplusplus |
| 18 | |
| 19 | typedef int charset[2]; |
| 20 | const charset x; |
| 21 | |
| 22 | char const *const *ccp; |
| 23 | char **p; |
| 24 | |
| 25 | struct point {int x, y;}; |
| 26 | static struct point const zero = {0,0}; |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | const char *g = "string"; |
| 32 | ccp = &g + (g ? g-g : 0); |
| |
| 33 | |
| 34 | ++ccp; |
| 35 | p = (char**) ccp; |
| 36 | ccp = (char const *const *) p; |
| 37 | { |
| 38 | char *t; |
| 2 | | 't' declared without an initial value | |
|
| 39 | char const *s = 0 ? (char *) 0 : (char const *) 0; |
| |
| 40 | |
| 41 | *t++ = 0; |
| 4 | | The expression is an uninitialized value. The computed value will also be garbage |
|
| 42 | } |
| 43 | { |
| 44 | int x[] = {25, 17}; |
| 45 | const int *foo = &x[0]; |
| 46 | ++foo; |
| 47 | } |
| 48 | { |
| 49 | typedef const int *iptr; |
| 50 | iptr p = 0; |
| 51 | ++p; |
| 52 | } |
| 53 | { |
| 54 | |
| 55 | struct s { int j; const int *ap[3]; }; |
| 56 | struct s *b; b->j = 5; |
| 57 | } |
| 58 | { |
| 59 | const int foo = 10; |
| 60 | } |
| 61 | #endif |
| 62 | |
| 63 | ; |
| 64 | return 0; |
| 65 | } |