mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 11:36:06 +00:00

Bison/YACC generated files result in a very large number of (presumably) false positives from the analyzer. These false positives are "true" in a sense of the information analyzer sees: assuming that the lexer can return any token at any point a number of uninitialized reads does occur. (naturally, the analyzer can not capture a complex invariant that certain tokens can only occur under certain conditions). Current fix simply stops analysis on those files. I have examined a very large number of such auto-generated files, and they do all start with such a comment. Conversely, user code is very unlikely to contain such a comment. rdar://33608161 Differential Revision: https://reviews.llvm.org/D43421 llvm-svn: 326135
14 lines
331 B
C
14 lines
331 B
C
/* A Bison parser, made by GNU Bison 1.875. */
|
|
|
|
// RUN: rm -rf %t.plist
|
|
// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=plist -o %t.plist -verify %s
|
|
// RUN: FileCheck --input-file=%t.plist %s
|
|
|
|
// expected-no-diagnostics
|
|
int foo() {
|
|
int *x = 0;
|
|
return *x; // no-warning
|
|
}
|
|
|
|
// CHECK: <key>diagnostics</key>
|