Can I safely use return inside GCC compound statement expressions ?
For example I define macro
#define CHECK_FUNC_RESULT(func) \
({ \
int result = func(); \
if (!result) return; \
result; \
})
and use it somewhere in code in such way:
int function1()
{
if (some_condition)
return 0;
...
return 1;
}
void function2()
{
if(CHECK_FUNC_RESULT(function1)) {
... to do something
}
}
Can I expect returning from function2 (on some_condition == true) without any undefined behavior ?