This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/17004] New: getting warning multiple times


If I compile this code with "-Wunreachable-code" I get
the warning

C:\Dev-Cpp\Projects\gcc-test\main.cpp
In constructor `CTest::CTest()':
19 C:\Dev-Cpp\Projects\gcc-test\main.cpp
[Warning] will never be executed

twice. If I put the constructor code inline in the class
definition I only get it once.

Happened on Windows 2000 SP4 with gcc-3.4.1-20040711-1, mingw-
runtime-3.3 and win32api-2.5.

I already reported it to the MinGW team
(http://sourceforge.net/tracker/index.php?func=detail&aid=992979&group_id=2435&atid=102435),
but I got no response yet. It was just assigned to dannysmith. Because I got no
Linux to check it for the same problem and because I got no responses, I thought
I might report it directly into GCC bugzilla.

#include <iostream>
#include <stdlib.h>

using namespace std;

class CTest
{
public:
CTest();
~CTest() {}
private:
int _impl;
};

CTest::CTest()
{
try {
_impl = 0;
}catch(...){
}
}

int main(int argc, char *argv[])
{
CTest test;

return 0;
}

-- 
           Summary: getting warning multiple times
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: oliverst at online dot de
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17004


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]