Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 343676 - false positive when break is part of an if/else block
Summary: false positive when break is part of an if/else block
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-codan (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 8.0   Edit
Assignee: Elena Laskavaia CLA
QA Contact: Elena Laskavaia CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-22 20:16 EDT by Matt Hargett CLA
Modified: 2011-04-24 15:23 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Hargett CLA 2011-04-22 20:16:15 EDT
Build Identifier: 201104150807

When a switch has a case, and the case has a break inside of a branching statement, the aforementioned warning gives a false positive: "No break at the end of this case"

Reproducible: Always

Steps to Reproduce:
code like this:
switch(type) {
			case ELEM_TYPE_ACCEPT:
				if (http_pipeline_base_request0->accept_rewrite || policyAcceptModified)
					continue;
				else
					break;
}
}
Comment 1 Elena Laskavaia CLA 2011-04-24 15:02:50 EDT
fixed 
(rewrote checker because current implementation was very complex and was not supporting complex structures, it was trying to use ast visitor which would not work for such checker)