Coverity uses several heuristics to identify when one case statement
legitimately falls through into the next, and a comment as the final item in a
case statement is one heuristic (the assumption being that it is a
justification for the fallthrough).
Use this to perform an audit of defects and hide the legitimate fallthroughs.
There are two bugfixes identified in the audit, both minor:
* 'n' command line handling for gtracestat
* BKSPC handling in xentop
All other identified defaults are legitimate fallthoughs
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Coverity-IDs:
1055464,
1055465,
1055467,
1055468,
1055481,
1055482
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
CC: Xen Coverity Team <coverity@xen.org>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Don Koch <dkoch@verizon.com>
switch (tolower((uint8_t)*endptr)) {
case 't':
kbytes <<= 10;
+ /* fallthrough */
case 'g':
kbytes <<= 10;
+ /* fallthrough */
case '\0':
case 'm':
kbytes <<= 10;
+ /* fallthrough */
case 'k':
break;
case 'b':
tsc2phase = atoll(optarg);
if (tsc2phase <= 0)
tsc2phase = 55800000UL;
+ break;
case 'd':
is_digest = 1;
break;
this->init();
return;
}
+ /* fallthrough */
case KEY_F(4):
exit(EXIT_SUCCESS);
}
case KEY_BACKSPACE:
if(prompt_val_len > 0)
prompt_val[--prompt_val_len] = '\0';
+ break;
default:
if((prompt_val_len+1) < PROMPT_VAL_LEN
&& isprint(ch)) {
errx(1, "Usage: %s %s[-h] [-s] [-t] key [...]", progname, mstr);
case MODE_exists:
mstr = incl_mode ? "exists " : "";
+ /* fallthrough */
case MODE_list:
mstr = mstr ? : incl_mode ? "list " : "";
errx(1, "Usage: %s %s[-h] [-p] [-s] key [...]", progname, mstr);