clang -cc1 -cc1 -triple x86_64-suse-linux -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name conftest.c -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 -analyzer-config-compatibility-mode=true -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/buildworker/marxinbox-gcc-clang-static-analyzer/objdir/libiberty -resource-dir /usr/lib64/clang/15.0.7 -internal-isystem /usr/lib64/clang/15.0.7/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -fdebug-compilation-dir=/buildworker/marxinbox-gcc-clang-static-analyzer/objdir/libiberty -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-output=plist-html -analyzer-config silence-checkers=core.NullDereference -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /buildworker/marxinbox-gcc-clang-static-analyzer/objdir/clang-static-analyzer/2023-03-27-141847-20772-1/report-dvBxgO.plist -x c conftest.c
1 | |
2 | #define PACKAGE_NAME "" |
3 | #define PACKAGE_TARNAME "" |
4 | #define PACKAGE_VERSION "" |
5 | #define PACKAGE_STRING "" |
6 | #define PACKAGE_BUGREPORT "" |
7 | #define PACKAGE_URL "" |
8 | #define STDC_HEADERS 1 |
9 | #define HAVE_SYS_TYPES_H 1 |
10 | #define HAVE_SYS_STAT_H 1 |
11 | #define HAVE_STDLIB_H 1 |
12 | #define HAVE_STRING_H 1 |
13 | #define HAVE_MEMORY_H 1 |
14 | #define HAVE_STRINGS_H 1 |
15 | #define HAVE_INTTYPES_H 1 |
16 | #define HAVE_STDINT_H 1 |
17 | #define HAVE_UNISTD_H 1 |
18 | #define __EXTENSIONS__ 1 |
19 | #define _ALL_SOURCE 1 |
20 | #define _GNU_SOURCE 1 |
21 | #define _POSIX_PTHREAD_SEMANTICS 1 |
22 | #define _TANDEM_SOURCE 1 |
23 | #define HAVE_SYS_FILE_H 1 |
24 | #define HAVE_SYS_PARAM_H 1 |
25 | #define HAVE_LIMITS_H 1 |
26 | #define HAVE_STDLIB_H 1 |
27 | #define HAVE_MALLOC_H 1 |
28 | #define HAVE_STRING_H 1 |
29 | #define HAVE_UNISTD_H 1 |
30 | #define HAVE_STRINGS_H 1 |
31 | #define HAVE_SYS_TIME_H 1 |
32 | #define HAVE_TIME_H 1 |
33 | #define HAVE_SYS_RESOURCE_H 1 |
34 | #define HAVE_SYS_STAT_H 1 |
35 | #define HAVE_SYS_MMAN_H 1 |
36 | #define HAVE_FCNTL_H 1 |
37 | #define HAVE_ALLOCA_H 1 |
38 | #define HAVE_SYS_SYSINFO_H 1 |
39 | #define HAVE_STDINT_H 1 |
40 | #define HAVE_STDIO_EXT_H 1 |
41 | #define HAVE_SYS_PRCTL_H 1 |
42 | #define HAVE_SYS_WAIT_H 1 |
43 | #define TIME_WITH_SYS_TIME 1 |
44 | #define SIZEOF_INT 4 |
45 | #define SIZEOF_LONG 8 |
46 | #define SIZEOF_SIZE_T 8 |
47 | #define HAVE_LONG_LONG 1 |
48 | #define SIZEOF_LONG_LONG 8 |
49 | #define UNSIGNED_64BIT_TYPE uint64_t |
50 | #define HAVE_INTPTR_T 1 |
51 | #define HAVE_UINTPTR_T 1 |
52 | #define HAVE_UINTPTR_T 1 |
53 | #define HAVE_ASPRINTF 1 |
54 | #define HAVE_ATEXIT 1 |
55 | #define HAVE_BASENAME 1 |
56 | #define HAVE_BCMP 1 |
57 | #define HAVE_BCOPY 1 |
58 | #define HAVE_BSEARCH 1 |
59 | #define HAVE_BZERO 1 |
60 | #define HAVE_CALLOC 1 |
61 | #define HAVE_CLOCK 1 |
62 | #define HAVE_FFS 1 |
63 | #define HAVE_GETCWD 1 |
64 | #define HAVE_GETPAGESIZE 1 |
65 | #define HAVE_GETTIMEOFDAY 1 |
66 | #define HAVE_INDEX 1 |
67 | #define HAVE_INSQUE 1 |
68 | #define HAVE_MEMCHR 1 |
69 | #define HAVE_MEMCMP 1 |
70 | #define HAVE_MEMCPY 1 |
71 | #define HAVE_MEMMEM 1 |
72 | #define HAVE_MEMMOVE 1 |
73 | #define HAVE_MEMPCPY 1 |
74 | #define HAVE_MEMSET 1 |
75 | #define HAVE_MKSTEMPS 1 |
76 | #define HAVE_PUTENV 1 |
77 | #define HAVE_RANDOM 1 |
78 | #define HAVE_RENAME 1 |
79 | #define HAVE_RINDEX 1 |
80 | #define HAVE_SETENV 1 |
81 | #define HAVE_SNPRINTF 1 |
82 | #define HAVE_SIGSETMASK 1 |
83 | #define HAVE_STPCPY 1 |
84 | #define HAVE_STPNCPY 1 |
85 | #define HAVE_STRCASECMP 1 |
86 | #define HAVE_STRCHR 1 |
87 | #define HAVE_STRDUP 1 |
88 | #define HAVE_STRNCASECMP 1 |
89 | #define HAVE_STRNDUP 1 |
90 | #define HAVE_STRNLEN 1 |
91 | #define HAVE_STRRCHR 1 |
92 | #define HAVE_STRSTR 1 |
93 | #define HAVE_STRTOD 1 |
94 | #define HAVE_STRTOL 1 |
95 | #define HAVE_STRTOUL 1 |
96 | #define HAVE_STRTOLL 1 |
97 | #define HAVE_STRTOULL 1 |
98 | #define HAVE_STRVERSCMP 1 |
99 | #define HAVE_TMPNAM 1 |
100 | #define HAVE_VASPRINTF 1 |
101 | #define HAVE_VFPRINTF 1 |
102 | #define HAVE_VPRINTF 1 |
103 | #define HAVE_VSNPRINTF 1 |
104 | #define HAVE_VSPRINTF 1 |
105 | #define HAVE_WAITPID 1 |
106 | |
107 | #include <stdlib.h> |
108 | |
109 | int |
110 | find_stack_direction (void) |
111 | { |
112 | static char *addr = 0; |
113 | auto char dummy; |
114 | if (addr == 0) |
| |
115 | { |
116 | addr = &dummy; |
117 | return find_stack_direction (); |
| 3 | | Address of stack memory associated with local variable 'dummy' is still referred to by the static variable 'addr' upon returning to the caller. This will be a dangling reference |
|
118 | } |
119 | else |
120 | return (&dummy > addr) ? 1 : -1; |
121 | } |
122 | |
123 | int |
124 | main (void) |
125 | { |
126 | exit (find_stack_direction() < 0); |
| 1 | Calling 'find_stack_direction' | |
|
127 | } |