Skip to content

False positives related to while loops in a threaded environment (Value stored to '...' is never read) #11235

@llvmbot

Description

@llvmbot
Bugzilla Link 10863
Version trunk
OS Linux
Reporter LLVM Bugzilla Contributor
CC @tkremenek

Extended Description

Hi,

I am using scan-build (svn from 2011-09-02) to analyze c++ code and get a few false positives related to while loops in a threaded environment. Below is a code
snippet for which I get "Value stored to 'first' during its initialization is
never read" in a large projet:


bool first = true;

while( this->m_continue ) {
// some mutex
if( first ) {
first = false;
foo();
}
else {
bar();
}
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions