-
-
usr/src/cmd/mdb/common/mdb/mdb_main.c (Diff revision 1) Nit: spurious space before ) ? But why not just add __NORETURN to :114
9309 mdb: this statement may fall through
Review Request #972 — Created March 18, 2018 and submitted
Information | |
---|---|
tsoome | |
illumos-gate | |
9309 | |
ea67737... | |
Reviewers | |
general | |
../../../common/mdb/mdb_io.c:906:5: error: this statement may fall through [-Werror=implicit-fallthrough=] n = (ushort_t)VA_ARG(ap, uint_t); ^ ../../../common/mdb/mdb_io.c:908:2: note: here default: ^~~~~~~ ../../../common/mdb/mdb_main.c:232:5: error: this statement may fall through [-Werror=implicit-fallthrough=] terminate(1); ^~~~~~~~~~~~ ../../../common/mdb/mdb_main.c:235:4: note: here case 'r': ^~~~ ../../../common/modules/idm/idm.c:2671:4: error: this statement may fall through [-Werror=implicit-fallthrough=] mdb_printf("%s|%s (%d)\n\t%9s %s (%d)\n", ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ts_string, state_name, sar->sar_state, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "New State", new_state_name, sar->sar_new_state); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../common/modules/idm/idm.c:2674:3: note: here default: ^~~~~~~ ../../kmdb/kmdb_dpi_isadep.c:53:9: error: this statement may fall through [-Werr or=implicit-fallthrough=] errno = EACCES; ../../kmdb/kmdb_dpi_isadep.c:54:2: note: here default: ^~~~~~~ cc1: all warnings being treated as errors
-
-
usr/src/cmd/mdb/common/modules/idm/idm.c (Diff revision 1) Wondering if these assignments should be moved to the
default:
just above so that there's not a chance of uninitialized usage for theSAR_STATE_CHANGE
mdb_printf()
.
-
-
usr/src/cmd/mdb/common/modules/idm/idm.c (Diff revision 1) Is this correct? You have a nested switch statement, the inner statement is setting state_name and new_state_name, then after the inner switch is complete, it is printing out the old + new state. WIth the fallthrough, it's then setting the state_name and new_state_name unconditionally. I suspect a
break
was meant to go there.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 2 (+6 -4) |