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]

bogus missing return warning from cvs g++



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

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