[LLVMbugs] [Bug 7616] New: clang-analyzer not warn about set-but-unused aggregates

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Jul 10 13:25:46 PDT 2010


           Summary: clang-analyzer not warn about set-but-unused
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: dimhen at gmail.com
                CC: llvmbugs at cs.uiuc.edu

with the following test program there are no diagnostics about set-but-unused

[root at wellesberg clang_errs]# cat aggregate.c
typedef struct {
    int a;
} S;

typedef union {
    int b;
    long c;
} U;

void foo()
    S s;
    U u;
    int x[10];

    s.a = 42;
    u.b = 42;
    x[0] = 42;
[root at wellesberg clang_errs]# scan-build gcc -c aggregate.c
scan-build: 'clang' executable not found in
scan-build: Using 'clang' from path: /usr/src/llvm/Release+Asserts/bin/clang
ANALYZE: aggregate.c foo
scan-build: Removing directory '/tmp/scan-build-2010-07-11-2' because it
contains no reports.
[root at wellesberg clang_errs]# clang -v
clang version 2.8 (trunk 108050)
Target: i386-pc-linux-gnu
Thread model: posix

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list