public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* wrong warning in  egcs-2.92.04 19980907
@ 1998-09-10  6:45 Christoph Koch
  1999-04-30 23:15 ` Gerald Pfeifer
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Koch @ 1998-09-10  6:45 UTC (permalink / raw)
  To: egcs-bugs, pfeifer

#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





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: wrong warning in  egcs-2.92.04 19980907
  1998-09-10  6:45 wrong warning in egcs-2.92.04 19980907 Christoph Koch
@ 1999-04-30 23:15 ` Gerald Pfeifer
  0 siblings, 0 replies; 2+ messages in thread
From: Gerald Pfeifer @ 1999-04-30 23:15 UTC (permalink / raw)
  To: Christoph Koch; +Cc: egcs-bugs, Wolfgang Faber

On Thu, 10 Sep 1998, Christoph Koch wrote:
> #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

This bug has been fixed in the current development version, i.e., it will
be fixed for the forthcoming 1.2 release as well!

I verified that with
  gcc version egcs-2.93.19 19990419 (gcc2 ss-980929 experimental)
on
  alkaid (which is now i386-unknown-freebsdelf)
as well as a slightly older version on sparc-sun-solaris2.6.

Gerald
-- 
Gerald "Jerry" pfeifer@dbai.tuwien.ac.at http://www.dbai.tuwien.ac.at/~pfeifer/



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-04-30 23:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-09-10  6:45 wrong warning in egcs-2.92.04 19980907 Christoph Koch
1999-04-30 23:15 ` Gerald Pfeifer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).