Commit 86fcc75
committed
examples/mi-mctp: fix warning for possibly uninitialised variable
gcc-12 with -Wuninitialized-var reports a warning for mi-mctp:
examples/mi-mctp.c: In function ‘do_action_endpoint’:
examples/mi-mctp.c:665:16: warning: ‘rc’ may be used uninitialized [-Wmaybe-uninitialized]
665 | return rc;
| ^~
examples/mi-mctp.c:637:13: note: ‘rc’ was declared here
637 | int rc;
| ^~
We shouldn't be able to hit this path, but explicitly set rc to an error
if we miss an enum case.
Fixes: #467
Signed-off-by: Jeremy Kerr <[email protected]>1 parent bd08e22 commit 86fcc75
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
661 | 661 | | |
662 | 662 | | |
663 | 663 | | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
664 | 670 | | |
665 | 671 | | |
666 | 672 | | |
| |||
0 commit comments