I am working on embedded C. Could somebody help me which piece of code?
Is efficient in terms of robustness, memory as well as Misra friendly?
Code1:
if (func() == 1 || func() == 2) {
/* Body of the function */
}
Code2:
locvar = func();
if (locvar == 1 || locvar == 2) {
/* Body of the function */
}