我正在研究嵌入式 C。有人可以帮助我哪一段代码吗?
在鲁棒性、内存以及 Misra 友好方面是否高效?
代码1:
if (func() == 1 || func() == 2) {
/* Body of the function */
}
Run Code Online (Sandbox Code Playgroud)
代码2:
locvar = func();
if (locvar == 1 || locvar == 2) {
/* Body of the function */
}
Run Code Online (Sandbox Code Playgroud)