You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
I'm going to call this a duplicate of bug #13399 . We don't currently reason about bitwise constraints, but we could consider adding a special case if it's the low bits that are being masked, because that can be represented as an integral range.
*** This bug has been marked as a duplicate of bug #13399 ***
llvmbot
transferred this issue from llvm/llvm-bugzilla-archive
Dec 9, 2021
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
The text was updated successfully, but these errors were encountered: