Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 359201 - False positive for No return, in function returning non-void
Summary: False positive for No return, in function returning non-void
Status: CLOSED DUPLICATE of bug 348386
Alias: None
Product: CDT
Classification: Tools
Component: cdt-codan (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: CDT Codan Inbox CLA
QA Contact: Elena Laskavaia CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-28 05:53 EDT by Dmitry Smirnov CLA
Modified: 2016-12-22 18:48 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***