Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 315525 - [f.p] False report for return if function is inside another function
Summary: [f.p] False report for return if function is inside another function
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-codan (show other bugs)
Version: 7.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Elena Laskavaia CLA
QA Contact: Elena Laskavaia CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-02 22:18 EDT by Sergey Prigogin CLA
Modified: 2010-06-08 11:05 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 Sergey Prigogin CLA 2010-06-02 22:18:42 EDT
void test() {
  class A {
   public:
    int m() {
      return 0;
    }
  };
}

return 0; statement is flagged with: Return vas value, in function returning void.
Comment 1 Elena Laskavaia CLA 2010-06-02 22:52:52 EDT
confused with function inside another one :O
Comment 2 CDT Genie CLA 2010-06-02 23:23:02 EDT
*** cdt cvs genie on behalf of elaskavaia ***
Bug 315525: fix to suppress errors in inner functions

[*] ReturnChecker.java 1.10 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/ReturnChecker.java?root=Tools_Project&r1=1.9&r2=1.10
Comment 3 Sergey Prigogin CLA 2010-06-02 23:34:48 EDT
(In reply to comment #2)

With this fix would 

void test() {
  class A {
   public:
    void m() {
      return 0;
    }
  };
}

still produce an error?
Comment 4 Elena Laskavaia CLA 2010-06-03 09:34:43 EDT
Nope. This is false negative now. I will fix it after 7.0
Comment 5 Elena Laskavaia CLA 2010-06-08 11:05:02 EDT
was fixed in 7.0