Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 359201

Summary: False positive for No return, in function returning non-void
Product: [Tools] CDT Reporter: Dmitry Smirnov <divis1969>
Component: cdt-codanAssignee: CDT Codan Inbox <cdt-codan-inbox>
Status: CLOSED DUPLICATE QA Contact: Elena Laskavaia <elaskavaia.cdt>
Severity: normal    
Priority: P3 CC: cdtdoug, yevshif, zeratul976
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Dmitry Smirnov CLA 2011-09-28 05:53:02 EDT
The following code produces the warning.
This seems to be invalid.
The problem is related to the semicolon ending the block of else. There is no warning if semicolon is missed.

int test1( int a ) {
	if( a == 1 )
		return 1;
	else {
		return 2;
	};
}
Comment 1 Elena Laskavaia CLA 2011-10-24 20:57:11 EDT
Technically it is same as  Bug 359202. Error reported in dead code.
Comment 2 Nathan Ridge CLA 2013-07-18 01:41:39 EDT
Duplicate of bug 348386.
Comment 3 Nathan Ridge CLA 2016-12-22 18:48:52 EST

*** This bug has been marked as a duplicate of bug 348386 ***