We build our project with Microsoft Visual Studio Professional 2015, Version 14.0.25431.01 Update 3
. Exactly the same code gives us compiler warning C4702
(unreachable code) when the solution is built for x86
platform, but no warning, when it is built for x64
platform.
The code looks like this:
if (is_some_condition)
Func_1();
else
Func_2();
LOG_MSG("...some logs...") // ----> compiler warning C4702 here!
Now, both Func_1
and Func_2
have an endless worker loop inside, like this:
void Func_1()
{
while(true)
{
// ...do something...
}
}
I understand, what the warning is about, but I do not understand, why it occurs only for x86
target and not for x64
. What's the difference here? Is the control flow different in any way and why? Please help.