Don't know if this is a bug or not ...
Bogus User
bogus_user@hotmail.com
Tue Aug 31 23:20:00 GMT 1999
> > > When I try to compile the following code
> > >
> > > class exc{
> > > public:
> > > exc(){ }
> > > };
> > >
> > > void main(){
> > > (1<2)?0:throw exc();
> > > }
> > >
> > >
> > > I get the error
> > > "converting to `void' from `int'"
> > >
> > > I've tried with egcs and gcc-2.95 and they both give the error.
>Should
> > this
> > > be an error?
> >
> > <plonk!>
> >
> > Read a C++ book and find out about main() and its return value.
> >
>
>I hate responding to myself, but I messed up..., hit SEND button
>instead of File Menu bar
>
>Anyway, I was under the same impression that you are...the result
>should be int and an r-value...it shouldn't be an error....
>
Similar code to this compiles ok using VC++ on NT, IBM's C++ on AIX, and
Sun's C++ on Solaris. I tried the example I gave on NT and it compiled
without errors or warnings.
I guess for now I'll just have to code around this problem.
Thanks,
Rich
_______________________________________________________________
Get Free Email and Do More On The Web. Visit http://www.msn.com
More information about the Gcc
mailing list