Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: heads up MS: unreachable code in Microsoft C++ STL file <xtree>

1 view
Skip to first unread message

Carl Daniel [VC++ MVP]

unread,
Jul 6, 2004, 3:30:31 PM7/6/04
to
How 'bout posting a repro case and the command-line options you used to
compile it?

-cd

Ebola_Influenza wrote:
> don't know if it's been fixed for VS .NET 2005, but here 'tis in 2003
>
> d:\program files\microsoft visual studio .net
> 2003\vc7\include\xtree(1116) : warning C4702: unreachable code
> d:\program files\microsoft visual studio .net
> 2003\vc7\include\xtree(1117) : warning C4702: unreachable code
> d:\program files\microsoft visual studio .net
> 2003\vc7\include\xtree(1118) : warning C4702: unreachable code
> d:\program files\microsoft visual studio .net
> 2003\vc7\include\xtree(1119) : warning C4702: unreachable code
> d:\program files\microsoft visual studio .net
> 2003\vc7\include\xtree(1121) : warning C4702: unreachable code


Ebola_Influenza

unread,
Jul 6, 2004, 4:16:02 PM7/6/04
to
sure, here 'tis:

main.cpp:

#include <map>
int main( int /* argc */, char** /* argv */ ) {
std::map<int, std::map<int, int> > _map;
return 0;
}

command-line args are ALL default with one exception: warning level 4, then build Release

thanks for getting back so soon!

Ebola_Influenza

unread,
Jul 6, 2004, 4:50:02 PM7/6/04
to
sorry, figured i'd better be specific about cmd-line options:

compiler = /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /EHsc /ML /GS /Fo"Release/" /Fd"Release/vc70.pdb" /W4 /nologo /c /Wp64 /Zi /TP

linker = /OUT:"Release/xtree_test.exe" /INCREMENTAL:NO /NOLOGO /DEBUG /PDB:"Release/xtree_test.pdb" /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /MACHINE:X86 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

hope that helps...

"Carl Daniel [VC++ MVP]" wrote:

Ebola_Influenza

unread,
Jul 6, 2004, 10:25:01 PM7/6/04
to
ok folks, tried this at home and it's not this simple, but don't have the professional edition compiler (like at work), so optimization is not available. don't know if that's it or not, but it's the only difference i can tell right now. i'll keep looking....

Bo Persson

unread,
Jul 7, 2004, 1:48:14 AM7/7/04
to

"Ebola_Influenza" <EbolaIn...@discussions.microsoft.com> skrev i
meddelandet news:3307731D-0392-46B7...@microsoft.com...

> sure, here 'tis:
>
> main.cpp:
>
> #include <map>
> int main( int /* argc */, char** /* argv */ ) {
> std::map<int, std::map<int, int> > _map;
> return 0;
> }
>
> command-line args are ALL default with one exception: warning level 4,
then build Release
>
> thanks for getting back so soon!
>

This is a known problem with the 2003 version. The lines below refer to
a try/catch clause, where the compiler realizes that for the data types
in use, there will never be any exceptions thrown. The catch clause is
thus unreachable.

You will have to disable this warning.

A quick test with the 2005 version indicates that it might have been
fixed there.


Bo Persson

0 new messages