I have a question about the following C code:
void my_function()
{
int i1;
int j1;
// Do something...
if (check_something())
{
if "check_something()" is easily evaluated to 0, that whole block will be optimized out using a sufficiently high level of optimization. Yes, it's compiler-dependent. Generally, if you're checking the return value of a function call, it won't be optimized out. The best way to approach this would be to compiler it and actually look at the disassembly of the file to verify what you think is happening is actually happening.