Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347390 - returning value after label produces "No return, in function returning non-void".
Summary: returning value after label produces "No return, in function returning non-vo...
Status: RESOLVED DUPLICATE of bug 346559
Alias: None
Product: CDT
Classification: Tools
Component: cdt-codan (show other bugs)
Version: 8.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: CDT Codan Inbox CLA
QA Contact: Elena Laskavaia CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-26 23:07 EDT by Soungjin Park CLA
Modified: 2013-08-25 04:34 EDT (History)
6 users (show)

See Also:


Attachments

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