...
Code Block | ||||
---|---|---|---|---|
| ||||
int do_xyz(void); int f(void) { /* ... */ if (do_xyz) { return -1; /* handle error Indicate failure */ } /* ... */ return 0; } |
Compliant Solution
In this compliant solution, the function do_xyz()
is invoked and the return value is compared to 0:
Code Block | ||||
---|---|---|---|---|
| ||||
int do_xyz(void); int f(void) { /* ... */ if (do_xyz()) { return -1; /* handle errorIndicate failure */ /* ... */ return 0; } |
Risk Assessment
Errors of omission can result in unintended program flow.
...