I describe the sample more closely here
extern int global = 0;
extern int *a = NULL;
void catchSigSegV( int sig )
{
a = &global;
}
int foo (int j)
{
signal (SIGSEGV, catchSigSegV);
if (*a && global) return 2;
return 0;
}
I admit that in most cases such a scenario is not common. This sample
seems to be a valid C program. So the conditions in IF shall be
evaluted strict in order of sequence-points, as first argument might
trap.
It doesn't matter if second argument have side-effects or none. The
point is the first and so it has to be separated from other
conditions.
Regards,
Kai