> >     Interesting.. if I gather the gist of the patch correctly,
> >     it looks like the change is to avoid having the void function
> >     return() a function that returns a void.
> >=20
> >     Which seems to compile OK with 'g++ -Wall' on my linux
> >     systems, eg. no compile errors for this:
> >=20
> > void foo() { }
> > void bar() {
> >    return(foo());           // OK with 'g++ -Wall'
> > }
> >=20
> >=20
> >     Is that maybe no longer allowed on the newer windows compilers?
>
> Yes - this is what I found, too.
>
> I think Fabien said it was VC6 that choked - so maybe it is *older*
> Windows compilers that don't allow this?
Yes, it also worked (at least) in vs2005 ; didn't test with 2003 or 2008 though.

That said, I was happy that the compiler makes this little problem visible, as 
it can hide a performance penalty and/or a bug.
It was harmless in this fragment of code because it's obvious to immediately 
figure it out as it was quite small and the compiler would certainly not even 
generate this return code. But on longer codes, I would regret the absence of 
this check on (modern / standard C++?) compilers.

Fabien

_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to