Use attribute to declare case statement fallthroughs

Clang does not recognise the comment style notification of expected
case statement fallthrough.

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2021-05-17 20:02:17 +10:00
parent 17ccc2f9c2
commit 58fde86668
3 changed files with 5 additions and 3 deletions

View file

@ -1026,7 +1026,7 @@ static int check_validity(alpm_handle_t *handle,
v->siglevel & ALPM_SIG_PACKAGE_OPTIONAL, v->siglevel & ALPM_SIG_PACKAGE_OPTIONAL,
v->siglevel & ALPM_SIG_PACKAGE_MARGINAL_OK, v->siglevel & ALPM_SIG_PACKAGE_MARGINAL_OK,
v->siglevel & ALPM_SIG_PACKAGE_UNKNOWN_OK); v->siglevel & ALPM_SIG_PACKAGE_UNKNOWN_OK);
/* fallthrough */ __attribute__((fallthrough));
case ALPM_ERR_PKG_INVALID_CHECKSUM: case ALPM_ERR_PKG_INVALID_CHECKSUM:
prompt_to_delete(handle, v->path, v->error); prompt_to_delete(handle, v->path, v->error);
break; break;

View file

@ -196,7 +196,7 @@ static void usage(int op, const char * const myname)
addlist(_(" --ignore <pkg> ignore a package upgrade (can be used more than once)\n")); addlist(_(" --ignore <pkg> ignore a package upgrade (can be used more than once)\n"));
addlist(_(" --ignoregroup <grp>\n" addlist(_(" --ignoregroup <grp>\n"
" ignore a group upgrade (can be used more than once)\n")); " ignore a group upgrade (can be used more than once)\n"));
/* fall through */ __attribute__((fallthrough));
case PM_OP_REMOVE: case PM_OP_REMOVE:
addlist(_(" -d, --nodeps skip dependency version checks (-dd to skip all checks)\n")); addlist(_(" -d, --nodeps skip dependency version checks (-dd to skip all checks)\n"));
addlist(_(" --assume-installed <package=version>\n" addlist(_(" --assume-installed <package=version>\n"
@ -412,7 +412,8 @@ static int parsearg_global(int opt)
unsigned short debug = (unsigned short)atoi(optarg); unsigned short debug = (unsigned short)atoi(optarg);
switch(debug) { switch(debug) {
case 2: case 2:
config->logmask |= ALPM_LOG_FUNCTION; /* fall through */ config->logmask |= ALPM_LOG_FUNCTION;
__attribute__((fallthrough));
case 1: case 1:
config->logmask |= ALPM_LOG_DEBUG; config->logmask |= ALPM_LOG_DEBUG;
break; break;

View file

@ -1069,6 +1069,7 @@ static char *pkg_get_location(alpm_pkg_t *pkg)
} }
/* fallthrough - for theoretical serverless repos */ /* fallthrough - for theoretical serverless repos */
__attribute__((fallthrough));
case ALPM_PKG_FROM_FILE: case ALPM_PKG_FROM_FILE:
return strdup(alpm_pkg_get_filename(pkg)); return strdup(alpm_pkg_get_filename(pkg));