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

Bug 347390

Summary: returning value after label produces "No return, in function returning non-void".
Product: [Tools] CDT Reporter: Soungjin Park <xcomart>
Component: cdt-codanAssignee: CDT Codan Inbox <cdt-codan-inbox>
Status: RESOLVED DUPLICATE QA Contact: Elena Laskavaia <elaskavaia.cdt>
Severity: normal    
Priority: P3 CC: cdtdoug, hjtrost, kosashi, vincent.legoll, yevshif, zeratul976
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Soungjin Park CLA 2011-05-26 23:07:55 EDT
Build Identifier: 20110505-1223

The following code triggers a warning "No return, in function returning
non-void":

int test(int ival) {
	int ires = -1;
	if (ival < 0) {
		printf("invalid argument.");
		goto SKIPOINT;
	}
	ires = 0;
SKIPOINT:
	return ival;
}


Reproducible: Always
Comment 1 Tomasz Wesolowski CLA 2011-06-14 10:50:49 EDT
Duplicate of #346559
Comment 3 Hans-Jochen Trost CLA 2011-09-02 18:50:15 EDT
(In reply to comment #1)
> Duplicate of #346559

This bug is still present under e.g. Windows XP SP3, despite the reported fix in #346559 (Linux), i.e., the fix seems not to have propagated yet:

Indigo Build id: 20110615-0604, downloaded and installed 26 Aug. 2011
(exclipse-cpp-indogo-incubation-win32.zip)
CDT 8.0.0.201106081058

No relevant update was found when looking 5 minutes before this post using the Update option in the Help menu in Eclipse.

Jochen
Comment 4 Nathan Ridge CLA 2013-08-24 17:25:07 EDT
I don't see this warning on either Windows or Linux.
Comment 5 Andrew Gvozdev CLA 2013-08-25 04:34:34 EDT
Yeah, and if I revert commit from bug 346559 it reappears.

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