ArtZ
November 24th, 2001, 12:05 AM
Why does the compiler flag the line XX below as "warning C4702: unreachable code".
Also, what is different from the compiler's view about this try - catch block vs. the previous ones below? The compiler does have - Enable exception handling checked under C++ language. Using MSVC 6.0. The try has an assignment statement wTool = 0. Just don't see why or where the limitation is, help! Also, I do not have this problem when compiling a DEBUG version of a Win32 DLL just a non-debug version. Again, this is during compile, not linking.
Thank you,
void SEHFunc();
char szTmp[64];
int mainxx()
{
int wTool;
try
{
SEHFunc();
}
catch( ... )
{
sprintf(szTmp,"Caught a C exception.");
}
try
{
SEHFunc();
}
catch( ... )
{
sprintf(szTmp,"Caught a C exception.");
}
try {
wTool = 0;
}
catch( ... )
{
sprintf(szTmp,"Caught a C exception."); // Line XX
}
return 0;
}
void SEHFunc()
{
__try
{
int x, y = 0;
x = 5 / y;
}
__finally
{
sprintf(szTmp, "In finally.");
}
}
Also, what is different from the compiler's view about this try - catch block vs. the previous ones below? The compiler does have - Enable exception handling checked under C++ language. Using MSVC 6.0. The try has an assignment statement wTool = 0. Just don't see why or where the limitation is, help! Also, I do not have this problem when compiling a DEBUG version of a Win32 DLL just a non-debug version. Again, this is during compile, not linking.
Thank you,
void SEHFunc();
char szTmp[64];
int mainxx()
{
int wTool;
try
{
SEHFunc();
}
catch( ... )
{
sprintf(szTmp,"Caught a C exception.");
}
try
{
SEHFunc();
}
catch( ... )
{
sprintf(szTmp,"Caught a C exception.");
}
try {
wTool = 0;
}
catch( ... )
{
sprintf(szTmp,"Caught a C exception."); // Line XX
}
return 0;
}
void SEHFunc()
{
__try
{
int x, y = 0;
x = 5 / y;
}
__finally
{
sprintf(szTmp, "In finally.");
}
}