Hi all,
With .NET 1.1, the following code does not give an error
during compilation:
Type*
foo()
{
if (0)
{
throw 1;
}
}
Note the lack of a possible valid return path! Typically, a C++
compiler will flag this with an error such as "not all control paths
return a value". However, with cl.exe and the /clr switch, no such
error is given.
However the biggest problem with this is its implicit behaviour - when
I call this, it actually returns me a NULL pointer. This just caused
me an hour of hair-pulling :-(
Hopefully someone from Microsoft can verify if this is a bug or
expected behaviour.
Thanks in advance,
Brian
Mattias Sj?gren - 27 Sep 2003 21:49 GMT
Brian,
>Hopefully someone from Microsoft can verify if this is a bug or
>expected behaviour.
You'll have more luck finding the right people if you re-post to
microsoft.public.dotnet.languages.vc.
Mattias

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.