SLIDE 21 example.c:16: ¡“result” ¡receives ¡unchecked ¡error ¡from ¡“status” ¡
21
1 ¡ ¡int ¡nextId(){ ¡ 2 ¡ ¡ ¡ ¡static ¡int ¡id; ¡ 3 ¡ ¡ ¡ ¡return ¡id++; ¡ 4 ¡ ¡} ¡ 5 ¡ 6 ¡ ¡int ¡getError(){ ¡ 7 ¡ ¡ ¡ ¡return ¡–EIO; ¡ 8 ¡ ¡} ¡ 9 ¡ 10 ¡int ¡load(){ ¡ 11 ¡ ¡ ¡int ¡status, ¡result ¡= ¡0; ¡ 12 ¡ 13 ¡ ¡ ¡if ¡(nextId()) ¡ 14 ¡ ¡ ¡ ¡ ¡ ¡status ¡= ¡getError(); ¡ 15 ¡ ¡ 16 ¡ ¡ ¡result ¡= ¡status; ¡ 17 ¡ 18 ¡ ¡ ¡if ¡(nextId()) ¡ 19 ¡ ¡ ¡ ¡ ¡ ¡result ¡= ¡-‑EPIPE; ¡ ¡ 20 ¡ 21 ¡ ¡return ¡result; ¡ 22 ¡} ¡ ¡
Complete diagnostic path trace
example.c:14: ¡“status” ¡receives ¡unchecked ¡error ¡from ¡funcEon ¡“getError” ¡ example.c:18: ¡“result” ¡has ¡unchecked ¡error ¡ example.c:3: ¡“result” ¡has ¡unchecked ¡error ¡ example.c:18: ¡“result” ¡has ¡unchecked ¡error ¡ example.c:19: ¡overwriEng ¡unchecked ¡error ¡in ¡“result” ¡ example.c:7: ¡unchecked ¡error ¡“EIO” ¡is ¡returned ¡
Diagnostic path slice
example.c:14: ¡“status” ¡receives ¡unchecked ¡error ¡from ¡funcEon ¡“getError” ¡ example.c:16: ¡“result” ¡receives ¡unchecked ¡error ¡from ¡“status” ¡ example.c:19: ¡overwriEng ¡unchecked ¡error ¡in ¡“result” ¡ example.c:7: ¡unchecked ¡error ¡“EIO” ¡is ¡returned ¡
Sample Output