hi,
I'm using arm-none-eabi-gcc 5.4, I'm not sure if there's problem as followed:
if ( ptr && ptr->member ) {
// do some thing....
}
The question is that, when compiled with -O1 or -O2, CPU will execute the condition (ptr->member) before the judgement ( NULL != ptr ) ???
Thanks Thomas.
I just doubt if that is safe, and have NOT test it with opmize option yet.
I post this question due to some other problem I encountered when -O2 enabled, which have not solved. I will raise a new post to describe it.
Thanks again for your attention.