Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] indexer problem - "return has value, in function returning void"

That is code analysis tool (codan).  I think it was fixed in 7.0.1,
you can report bug anyway, I will close it if it is fixed.

On Thu, Aug 12, 2010 at 2:41 PM, Tim Black <timblaktu@xxxxxxxxx> wrote:
> I have some void functions that return the value from other void functions,
> and the indexer erroneously reports "return has value, in function returning
> void" in some cases. The compiler of course is fine with this, so when I
> compile, the Problem window clears. But when the indexer runs again, they
> come back. This problem seems to happen only when the inner void function is
> defined in another file.
>
> So, these defs in a .h cause the error:
>
> #include <vector>
> using std::vector;
>     template <class T>
>     class MyVector {
>       private:
>         vector<int> m_v;
>       public:
>         MyVector() : m_v() {}
>         void push_back(T t) { return m_v.push_back(t); }  // "Return has
> value, in function returning void"
>     };
>
> But this in a .h does not:
>
>     template <class T>
>     class MyClass {
>         void foo() { return goo(); }
>         void goo() {}
>     };
>
> And this in a .cpp does not:
>
> void goo() { }
> void foo() {
>   return goo();
> }
>
> I searched bugzilla and couldn't find any corresponding issue.
>
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>
>


Back to the top