wrong warning in egcs-2.92.04 19980907

Christoph Koch e9425227@student.tuwien.ac.at
Thu Sep 10 06:45:00 GMT 1998


#include <vector.h>


class A { };    


struct B     
{    
   vector<A>* a;              

   ~B() { delete a; }      
};    


struct C     
{     
   bool fn(void) const         
   {     
      B b;         
        
      if(true)
         return true;
      else
         return false;
   }     
};  


alkaid.dbai.tuwien.ac.at[298]% egcs -v
Reading specs from /sw/swtest/egcs/BSD/lib/gcc-lib/i386-unknown-freebsd2.2.7/egcs-2.92.04/specs
gcc version egcs-2.92.04 19980907 (gcc2 ss-980609 experimental)
alkaid.dbai.tuwien.ac.at[302]% egcs -c -O3 -Wall o3nonvoidfnbug.C
o3nonvoidfnbug.C: In method `bool C::fn() const':
o3nonvoidfnbug.C:25: warning: control reaches end of non-void function `C::fn() const'
alkaid.dbai.tuwien.ac.at[303]% egcs -c -Wall o3nonvoidfnbug.C
alkaid.dbai.tuwien.ac.at[304]% 


Hope this helps

Christoph






More information about the Gcc-bugs mailing list