Skip to content

False positive: "Undefined or garbage value returned to caller" #18683

Closed
@llvmbot

Description

@llvmbot
Bugzilla Link 18309
Resolution DUPLICATE
Resolved on Dec 23, 2013 12:40
Version trunk
OS Linux
Attachments Simple test case
Reporter LLVM Bugzilla Contributor
CC @belkadan

Extended Description

Using:
clang version 3.5 (trunk 197863)
Target: x86_64-unknown-linux-gnu
Thread model: posix

I'm getting a false positive "Undefined or garbage value returned to caller" for a variable which is guaranteed to be written to in one of the 'case' entries of a 'switch' statement.

Test case attached. Note, that false positive is not given for a switch() on enum values, but it is given for switch() on an int where two bits are masked out.

Use: scan-build --use-analyzer <...>/bin/clang gcc -std=c99 -o test.o -c test.c

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions