| 1 |
; analyzer.opt -- Options for the analyzer. |
| 2 |
|
| 3 |
; Copyright (C) 2019-2025 Free Software Foundation, Inc. |
| 4 |
; |
| 5 |
; This file is part of GCC. |
| 6 |
; |
| 7 |
; GCC is free software; you can redistribute it and/or modify it under |
| 8 |
; the terms of the GNU General Public License as published by the Free |
| 9 |
; Software Foundation; either version 3, or (at your option) any later |
| 10 |
; version. |
| 11 |
; |
| 12 |
; GCC is distributed in the hope that it will be useful, but WITHOUT ANY |
| 13 |
; WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 14 |
; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 15 |
; for more details. |
| 16 |
; |
| 17 |
; You should have received a copy of the GNU General Public License |
| 18 |
; along with GCC; see the file COPYING3. If not see |
| 19 |
; <http://www.gnu.org/licenses/>. |
| 20 |
|
| 21 |
; See the GCC internals manual for a description of this file's format. |
| 22 |
|
| 23 |
; Please try to keep this file in ASCII collating order. |
| 24 |
|
| 25 |
-param=analyzer-bb-explosion-factor= |
| 26 |
Common Joined UInteger Var(param_analyzer_bb_explosion_factor) Init(5) Param |
| 27 |
The maximum number of 'after supernode' exploded nodes within the analyzer per supernode, before terminating analysis. |
| 28 |
|
| 29 |
-param=analyzer-max-enodes-per-program-point= |
| 30 |
Common Joined UInteger Var(param_analyzer_max_enodes_per_program_point) Init(8) Param |
| 31 |
The maximum number of exploded nodes per program point within the analyzer, before terminating analysis of that point. |
| 32 |
|
| 33 |
-param=analyzer-max-constraints= |
| 34 |
Common Joined UInteger Var(param_analyzer_max_constraints) Init(20) Param |
| 35 |
The maximum number of constraints per state. |
| 36 |
|
| 37 |
-param=analyzer-max-infeasible-edges= |
| 38 |
Common Joined UInteger Var(param_analyzer_max_infeasible_edges) Init(10) Param |
| 39 |
The maximum number of infeasible edges to reject before declaring a diagnostic as infeasible. |
| 40 |
|
| 41 |
-param=analyzer-max-recursion-depth= |
| 42 |
Common Joined UInteger Var(param_analyzer_max_recursion_depth) Init(2) Param |
| 43 |
The maximum number of times a callsite can appear in a call stack within the analyzer, before terminating analysis of a call that would recurse deeper. |
| 44 |
|
| 45 |
-param=analyzer-max-svalue-depth= |
| 46 |
Common Joined UInteger Var(param_analyzer_max_svalue_depth) Init(18) Param |
| 47 |
The maximum depth of a symbolic value, before approximating the value as unknown. |
| 48 |
|
| 49 |
-param=analyzer-min-snodes-for-call-summary= |
| 50 |
Common Joined UInteger Var(param_analyzer_min_snodes_for_call_summary) Init(10) Param |
| 51 |
The minimum number of supernodes within a function for the analyzer to consider summarizing its effects at call sites. |
| 52 |
|
| 53 |
-param=analyzer-max-enodes-for-full-dump= |
| 54 |
Common Joined UInteger Var(param_analyzer_max_enodes_for_full_dump) Init(200) Param |
| 55 |
The maximum depth of exploded nodes that should appear in a dot dump before switching to a less verbose format. |
| 56 |
|
| 57 |
-param=analyzer-text-art-string-ellipsis-threshold= |
| 58 |
Common Joined UInteger Var(param_analyzer_text_art_string_ellipsis_threshold) Init(15) Param |
| 59 |
The number of bytes at which to ellipsize string literals in analyzer text art diagrams. |
| 60 |
|
| 61 |
-param=analyzer-text-art-string-ellipsis-head-len= |
| 62 |
Common Joined UInteger Var(param_analyzer_text_art_string_ellipsis_head_len) Init(6) Param |
| 63 |
The number of literal bytes to show at the head of a string literal in text art when ellipsizing it. |
| 64 |
|
| 65 |
-param=analyzer-text-art-string-ellipsis-tail-len= |
| 66 |
Common Joined UInteger Var(param_analyzer_text_art_string_ellipsis_tail_len) Init(6) Param |
| 67 |
The number of literal bytes to show at the tail of a string literal in text art when ellipsizing it. |
| 68 |
|
| 69 |
-param=analyzer-text-art-ideal-canvas-width= |
| 70 |
Common Joined UInteger Var(param_analyzer_text_art_ideal_canvas_width) Init(72) Param |
| 71 |
The ideal width in characters of text art diagrams generated by the analyzer. |
| 72 |
|
| 73 |
Wanalyzer-allocation-size |
| 74 |
Common Var(warn_analyzer_allocation_size) Init(1) Warning |
| 75 |
Warn about code paths in which a pointer to a buffer is assigned to an incompatible type. |
| 76 |
|
| 77 |
Wanalyzer-deref-before-check |
| 78 |
Common Var(warn_analyzer_deref_before_check) Init(1) Warning |
| 79 |
Warn about code paths in which a pointer is checked for NULL after it has already been dereferenced. |
| 80 |
|
| 81 |
Wanalyzer-double-fclose |
| 82 |
Common Var(warn_analyzer_double_fclose) Init(1) Warning |
| 83 |
Warn about code paths in which a stdio FILE can be closed more than once. |
| 84 |
|
| 85 |
Wanalyzer-double-free |
| 86 |
Common Var(warn_analyzer_double_free) Init(1) Warning |
| 87 |
Warn about code paths in which a pointer can be freed more than once. |
| 88 |
|
| 89 |
Wanalyzer-exposure-through-output-file |
| 90 |
Common Var(warn_analyzer_exposure_through_output_file) Init(1) Warning |
| 91 |
Warn about code paths in which sensitive data is written to a file. |
| 92 |
|
| 93 |
Wanalyzer-exposure-through-uninit-copy |
| 94 |
Common Var(warn_analyzer_exposure_through_uninit_copy) Init(1) Warning |
| 95 |
Warn about code paths in which sensitive data is copied across a security boundary. |
| 96 |
|
| 97 |
Wanalyzer-fd-access-mode-mismatch |
| 98 |
Common Var(warn_analyzer_fd_mode_mismatch) Init(1) Warning |
| 99 |
Warn about code paths in which read on a write-only file descriptor is attempted, or vice versa. |
| 100 |
|
| 101 |
Wanalyzer-fd-double-close |
| 102 |
Common Var(warn_analyzer_fd_double_close) Init(1) Warning |
| 103 |
Warn about code paths in which a file descriptor can be closed more than once. |
| 104 |
|
| 105 |
Wanalyzer-fd-leak |
| 106 |
Common Var(warn_analyzer_fd_leak) Init(1) Warning |
| 107 |
Warn about code paths in which a file descriptor is not closed. |
| 108 |
|
| 109 |
Wanalyzer-fd-phase-mismatch |
| 110 |
Common Var(warn_analyzer_fd_phase_mismatch) Init(1) Warning |
| 111 |
Warn about code paths in which an operation is attempted in the wrong phase of a file descriptor's lifetime. |
| 112 |
|
| 113 |
Wanalyzer-fd-type-mismatch |
| 114 |
Common Var(warn_analyzer_fd_type_mismatch) Init(1) Warning |
| 115 |
Warn about code paths in which an operation is attempted on the wrong type of file descriptor. |
| 116 |
|
| 117 |
Wanalyzer-fd-use-after-close |
| 118 |
Common Var(warn_analyzer_fd_use_after_close) Init(1) Warning |
| 119 |
Warn about code paths in which a read or write is performed on a closed file descriptor. |
| 120 |
|
| 121 |
Wanalyzer-fd-use-without-check |
| 122 |
Common Var(warn_analyzer_fd_use_without_check) Init(1) Warning |
| 123 |
Warn about code paths in which a file descriptor is used without being checked for validity. |
| 124 |
|
| 125 |
Wanalyzer-file-leak |
| 126 |
Common Var(warn_analyzer_file_leak) Init(1) Warning |
| 127 |
Warn about code paths in which a stdio FILE is not closed. |
| 128 |
|
| 129 |
Wanalyzer-free-of-non-heap |
| 130 |
Common Var(warn_analyzer_free_of_non_heap) Init(1) Warning |
| 131 |
Warn about code paths in which a non-heap pointer is freed. |
| 132 |
|
| 133 |
Wanalyzer-imprecise-fp-arithmetic |
| 134 |
Common Var(warn_analyzer_imprecise_fp_arithmetic) Init(1) Warning |
| 135 |
Warn about code paths in which floating-point arithmetic is used in locations where precise computation is needed. |
| 136 |
|
| 137 |
Wanalyzer-infinite-loop |
| 138 |
Common Var(warn_analyzer_infinite_loop) Init(1) Warning |
| 139 |
Warn about code paths which appear to lead to an infinite loop. |
| 140 |
|
| 141 |
Wanalyzer-infinite-recursion |
| 142 |
Common Var(warn_analyzer_infinite_recursion) Init(1) Warning |
| 143 |
Warn about code paths which appear to lead to infinite recursion. |
| 144 |
|
| 145 |
Wanalyzer-jump-through-null |
| 146 |
Common Var(warn_analyzer_jump_through_null) Init(1) Warning |
| 147 |
Warn about code paths in which a NULL function pointer is called. |
| 148 |
|
| 149 |
Wanalyzer-malloc-leak |
| 150 |
Common Var(warn_analyzer_malloc_leak) Init(1) Warning |
| 151 |
Warn about code paths in which a heap-allocated pointer leaks. |
| 152 |
|
| 153 |
Wanalyzer-mismatching-deallocation |
| 154 |
Common Var(warn_analyzer_mismatching_deallocation) Init(1) Warning |
| 155 |
Warn about code paths in which the wrong deallocation function is called. |
| 156 |
|
| 157 |
Wanalyzer-out-of-bounds |
| 158 |
Common Var(warn_analyzer_out_of_bounds) Init(1) Warning |
| 159 |
Warn about code paths in which a write or read to a buffer is out-of-bounds. |
| 160 |
|
| 161 |
Wanalyzer-overlapping-buffers |
| 162 |
Common Var(warn_analyzer_overlapping_buffers) Init(1) Warning |
| 163 |
Warn about code paths in which undefined behavior would occur due to overlapping buffers. |
| 164 |
|
| 165 |
Wanalyzer-possible-null-argument |
| 166 |
Common Var(warn_analyzer_possible_null_argument) Init(1) Warning |
| 167 |
Warn about code paths in which a possibly-NULL value is passed to a must-not-be-NULL function argument. |
| 168 |
|
| 169 |
Wanalyzer-possible-null-dereference |
| 170 |
Common Var(warn_analyzer_possible_null_dereference) Init(1) Warning |
| 171 |
Warn about code paths in which a possibly-NULL pointer is dereferenced. |
| 172 |
|
| 173 |
Wanalyzer-unsafe-call-within-signal-handler |
| 174 |
Common Var(warn_analyzer_unsafe_call_within_signal_handler) Init(1) Warning |
| 175 |
Warn about code paths in which an async-signal-unsafe function is called from a signal handler. |
| 176 |
|
| 177 |
Wanalyzer-null-argument |
| 178 |
Common Var(warn_analyzer_null_argument) Init(1) Warning |
| 179 |
Warn about code paths in which NULL is passed to a must-not-be-NULL function argument. |
| 180 |
|
| 181 |
Wanalyzer-null-dereference |
| 182 |
Common Var(warn_analyzer_null_dereference) Init(1) Warning |
| 183 |
Warn about code paths in which a NULL pointer is dereferenced. |
| 184 |
|
| 185 |
Wanalyzer-putenv-of-auto-var |
| 186 |
Common Var(warn_analyzer_putenv_of_auto_var) Init(1) Warning |
| 187 |
Warn about code paths in which an on-stack buffer is passed to putenv. |
| 188 |
|
| 189 |
Wanalyzer-shift-count-negative |
| 190 |
Common Var(warn_analyzer_shift_count_negative) Init(1) Warning |
| 191 |
Warn about code paths in which a shift with negative count is attempted. |
| 192 |
|
| 193 |
Wanalyzer-shift-count-overflow |
| 194 |
Common Var(warn_analyzer_shift_count_overflow) Init(1) Warning |
| 195 |
Warn about code paths in which a shift with count >= width of type is attempted. |
| 196 |
|
| 197 |
Wanalyzer-stale-setjmp-buffer |
| 198 |
Common Var(warn_analyzer_stale_setjmp_buffer) Init(1) Warning |
| 199 |
Warn about code paths in which a longjmp rewinds to a jmp_buf saved in a stack frame that has returned. |
| 200 |
|
| 201 |
Wanalyzer-tainted-allocation-size |
| 202 |
Common Var(warn_analyzer_tainted_allocation_size) Init(1) Warning |
| 203 |
Warn about code paths in which an unsanitized value is used as an allocation size. |
| 204 |
|
| 205 |
Wanalyzer-tainted-array-index |
| 206 |
Common Var(warn_analyzer_tainted_array_index) Init(1) Warning |
| 207 |
Warn about code paths in which an unsanitized value is used as an array index. |
| 208 |
|
| 209 |
Wanalyzer-tainted-assertion |
| 210 |
Common Var(warn_analyzer_tainted_assertion) Init(1) Warning |
| 211 |
Warn about code paths in which an 'assert()' is made involving an unsanitized value. |
| 212 |
|
| 213 |
Wanalyzer-tainted-divisor |
| 214 |
Common Var(warn_analyzer_tainted_divisor) Init(1) Warning |
| 215 |
Warn about code paths in which an unsanitized value is used as a divisor. |
| 216 |
|
| 217 |
Wanalyzer-tainted-offset |
| 218 |
Common Var(warn_analyzer_tainted_offset) Init(1) Warning |
| 219 |
Warn about code paths in which an unsanitized value is used as a pointer offset. |
| 220 |
|
| 221 |
Wanalyzer-tainted-size |
| 222 |
Common Var(warn_analyzer_tainted_size) Init(1) Warning |
| 223 |
Warn about code paths in which an unsanitized value is used as a size. |
| 224 |
|
| 225 |
Wanalyzer-undefined-behavior-ptrdiff |
| 226 |
Common Var(warn_analyzer_undefined_behavior_ptrdiff) Init(1) Warning |
| 227 |
Warn about code paths in which pointer subtraction involves undefined behavior. |
| 228 |
|
| 229 |
Wanalyzer-undefined-behavior-strtok |
| 230 |
Common Var(warn_analyzer_undefined_behavior_strtok) Init(1) Warning |
| 231 |
Warn about code paths in which a call is made to strtok with undefined behavior. |
| 232 |
|
| 233 |
Wanalyzer-use-after-free |
| 234 |
Common Var(warn_analyzer_use_after_free) Init(1) Warning |
| 235 |
Warn about code paths in which a freed value is used. |
| 236 |
|
| 237 |
Wanalyzer-use-of-pointer-in-stale-stack-frame |
| 238 |
Common Var(warn_analyzer_use_of_pointer_in_stale_stack_frame) Init(1) Warning |
| 239 |
Warn about code paths in which a pointer to a stale stack frame is used. |
| 240 |
|
| 241 |
Wanalyzer-va-arg-type-mismatch |
| 242 |
Common Var(warn_analyzer_va_arg_type_mismatch) Init(1) Warning |
| 243 |
Warn about code paths in which va_arg uses the wrong type. |
| 244 |
|
| 245 |
Wanalyzer-va-list-exhausted |
| 246 |
Common Var(warn_analyzer_va_list_exhausted) Init(1) Warning |
| 247 |
Warn about code paths in which va_arg is used too many times on a va_list. |
| 248 |
|
| 249 |
Wanalyzer-va-list-leak |
| 250 |
Common Var(warn_analyzer_va_list_leak) Init(1) Warning |
| 251 |
Warn about code paths in which va_start or va_copy is used without a corresponding va_end. |
| 252 |
|
| 253 |
Wanalyzer-va-list-use-after-va-end |
| 254 |
Common Var(warn_analyzer_va_list_use_after_va_end) Init(1) Warning |
| 255 |
Warn about code paths in which a va_list is used after va_end. |
| 256 |
|
| 257 |
Wanalyzer-write-to-const |
| 258 |
Common Var(warn_analyzer_write_to_const) Init(1) Warning |
| 259 |
Warn about code paths which attempt to write to a const object. |
| 260 |
|
| 261 |
Wanalyzer-write-to-string-literal |
| 262 |
Common Var(warn_analyzer_write_to_string_literal) Init(1) Warning |
| 263 |
Warn about code paths which attempt to write to a string literal. |
| 264 |
|
| 265 |
Wanalyzer-use-of-uninitialized-value |
| 266 |
Common Var(warn_analyzer_use_of_uninitialized_value) Init(1) Warning |
| 267 |
Warn about code paths in which an uninitialized value is used. |
| 268 |
|
| 269 |
Wanalyzer-symbol-too-complex |
| 270 |
Common Var(warn_analyzer_symbol_too_complex) Init(0) Warning |
| 271 |
Warn if expressions are too complicated for the analyzer to fully track. |
| 272 |
|
| 273 |
Wanalyzer-too-complex |
| 274 |
Common Var(warn_analyzer_too_complex) Init(0) Warning |
| 275 |
Warn if the code is too complicated for the analyzer to fully explore. |
| 276 |
|
| 277 |
fanalyzer-checker= |
| 278 |
Common Joined RejectNegative Var(flag_analyzer_checker) |
| 279 |
Restrict the analyzer to run just the named checker. |
| 280 |
|
| 281 |
fanalyzer-debug-text-art |
| 282 |
Common Var(flag_analyzer_debug_text_art) Init(0) |
| 283 |
Add extra annotations to diagrams. |
| 284 |
|
| 285 |
fanalyzer-fine-grained |
| 286 |
Common Var(flag_analyzer_fine_grained) Init(0) |
| 287 |
Avoid combining multiple statements into one exploded edge. |
| 288 |
|
| 289 |
fanalyzer-feasibility |
| 290 |
Common Var(flag_analyzer_feasibility) Init(1) |
| 291 |
Verify that paths are feasible when emitting diagnostics. |
| 292 |
|
| 293 |
fanalyzer-show-duplicate-count |
| 294 |
Common Var(flag_analyzer_show_duplicate_count) Init(0) |
| 295 |
Issue a note when diagnostics are deduplicated. |
| 296 |
|
| 297 |
fanalyzer-state-purge |
| 298 |
Common Var(flag_analyzer_state_purge) Init(1) |
| 299 |
Purge unneeded state during analysis. |
| 300 |
|
| 301 |
fanalyzer-state-merge |
| 302 |
Common Var(flag_analyzer_state_merge) Init(1) |
| 303 |
Merge similar-enough states during analysis. |
| 304 |
|
| 305 |
fanalyzer-suppress-followups |
| 306 |
Common Var(flag_analyzer_suppress_followups) Init(1) |
| 307 |
Stop exploring an execution path after certain diagnostics. |
| 308 |
|
| 309 |
fanalyzer-transitivity |
| 310 |
Common Var(flag_analyzer_transitivity) Init(0) |
| 311 |
Enable transitivity of constraints during analysis. |
| 312 |
|
| 313 |
fanalyzer-show-events-in-system-headers |
| 314 |
Common Var(flag_analyzer_show_events_in_system_headers) Init(0) |
| 315 |
Show events within system headers in analyzer execution paths. |
| 316 |
|
| 317 |
fanalyzer-call-summaries |
| 318 |
Common Var(flag_analyzer_call_summaries) Init(0) |
| 319 |
Approximate the effect of function calls to simplify analysis. |
| 320 |
|
| 321 |
fanalyzer-undo-inlining |
| 322 |
Common Var(flag_analyzer_undo_inlining) Init(1) |
| 323 |
Try to reconstruct function calls and returns after inlining. |
| 324 |
|
| 325 |
fanalyzer-verbose-edges |
| 326 |
Common Var(flag_analyzer_verbose_edges) Init(0) |
| 327 |
Emit more verbose descriptions of control flow in diagnostics. |
| 328 |
|
| 329 |
fanalyzer-verbose-state-changes |
| 330 |
Common Var(flag_analyzer_verbose_state_changes) Init(0) |
| 331 |
Emit more verbose descriptions of state changes in diagnostics. |
| 332 |
|
| 333 |
fanalyzer-verbosity= |
| 334 |
Common Joined UInteger Var(analyzer_verbosity) Init(2) |
| 335 |
Control which events are displayed in diagnostic paths. |
| 336 |
|
| 337 |
fdump-analyzer |
| 338 |
Common RejectNegative Var(flag_dump_analyzer) |
| 339 |
Dump various analyzer internals to SRCFILE.analyzer.txt. |
| 340 |
|
| 341 |
fdump-analyzer-stderr |
| 342 |
Common RejectNegative Var(flag_dump_analyzer_stderr) |
| 343 |
Dump various analyzer internals to stderr. |
| 344 |
|
| 345 |
fdump-analyzer-callgraph |
| 346 |
Common RejectNegative Var(flag_dump_analyzer_callgraph) |
| 347 |
Dump analyzer-specific call graph information to a SRCFILE.callgraph.dot file. |
| 348 |
|
| 349 |
fdump-analyzer-exploded-graph |
| 350 |
Common RejectNegative Var(flag_dump_analyzer_exploded_graph) |
| 351 |
Dump the analyzer exploded graph to a SRCFILE.eg.dot file. |
| 352 |
|
| 353 |
fdump-analyzer-exploded-nodes |
| 354 |
Common RejectNegative Var(flag_dump_analyzer_exploded_nodes) |
| 355 |
Emit diagnostics showing the location of nodes in the exploded graph. |
| 356 |
|
| 357 |
fdump-analyzer-exploded-nodes-2 |
| 358 |
Common RejectNegative Var(flag_dump_analyzer_exploded_nodes_2) |
| 359 |
Dump a textual representation of the exploded graph to SRCFILE.eg.txt. |
| 360 |
|
| 361 |
fdump-analyzer-exploded-nodes-3 |
| 362 |
Common RejectNegative Var(flag_dump_analyzer_exploded_nodes_3) |
| 363 |
Dump a textual representation of the exploded graph to SRCFILE.eg-ID.txt. |
| 364 |
|
| 365 |
fdump-analyzer-exploded-paths |
| 366 |
Common RejectNegative Var(flag_dump_analyzer_exploded_paths) |
| 367 |
Dump a textual representation of each diagnostic's exploded path to SRCFILE.IDX.KIND.epath.txt. |
| 368 |
|
| 369 |
fdump-analyzer-feasibility |
| 370 |
Common RejectNegative Var(flag_dump_analyzer_feasibility) |
| 371 |
Dump various analyzer internals to SRCFILE.*.fg.dot and SRCFILE.*.tg.dot. |
| 372 |
|
| 373 |
fdump-analyzer-infinite-loop |
| 374 |
Common RejectNegative Var(flag_dump_analyzer_infinite_loop) |
| 375 |
Dump various analyzer internals to SRCFILE.*.infinite-loop.dot. |
| 376 |
|
| 377 |
fdump-analyzer-json |
| 378 |
Common RejectNegative Var(flag_dump_analyzer_json) |
| 379 |
Dump analyzer-specific data to a SRCFILE.analyzer.json.gz file. |
| 380 |
|
| 381 |
fdump-analyzer-state-purge |
| 382 |
Common RejectNegative Var(flag_dump_analyzer_state_purge) |
| 383 |
Dump state-purging information to a SRCFILE.state-purge.dot file. |
| 384 |
|
| 385 |
fdump-analyzer-supergraph |
| 386 |
Common RejectNegative Var(flag_dump_analyzer_supergraph) |
| 387 |
Dump the analyzer supergraph to a SRCFILE.supergraph.dot file. |
| 388 |
|
| 389 |
fdump-analyzer-untracked |
| 390 |
Common RejectNegative Var(flag_dump_analyzer_untracked) |
| 391 |
Emit custom warnings with internal details intended for analyzer developers. |
| 392 |
|
| 393 |
; This comment is to ensure we retain the blank line above. |