This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
bogus missing return warning from cvs g++
- To: bug-gcc at gnu dot org
- Subject: bogus missing return warning from cvs g++
- From: scott snyder <snyder at fnal dot gov>
- Date: Wed, 08 Mar 2000 21:49:41 CST
hi -
For the following input, cvs g++ (2.96 20000306 on i686-pc-linux-gnu)
gives what appears to be a bogus warning when -Wall is used:
-- egcsbug10.cc ------------------------------------------------------------
struct string {
string ();
~string ();
};
struct Result
{
Result(int x);
};
Result processEvent()
{
string hcname[1];
string thisHCname;
return 0;
}
----------------------------------------------------------------------------
$ ./cc1plus -quiet -Wall egcsbug10.cc
egcsbug10.cc: In function `Result processEvent ()':
egcsbug10.cc:16: warning: control reaches end of non-void function
egcsbug10.cc:16: warning: `processEvent ()'
gcc appears to be complaining that the function doesn't return a value,
when it in fact does. Removing either of the two `string' declarations
makes the warning go away.
thanks,
sss