summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2021-05-17 12:02:17 +0200
committerAllan McRae <allan@archlinux.org>2021-05-17 12:02:21 +0200
commit58fde8666896639e5cfb3923fbbfd52d166bffe7 (patch)
tree5682cc41c9f3389d9b1e799bf0c69d529a081f61
parent17ccc2f9c22914d1c20b4f7849130c4171fed54b (diff)
downloadpacman-58fde8666896639e5cfb3923fbbfd52d166bffe7.tar.gz
pacman-58fde8666896639e5cfb3923fbbfd52d166bffe7.tar.xz
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>
-rw-r--r--lib/libalpm/sync.c2
-rw-r--r--src/pacman/pacman.c5
-rw-r--r--src/pacman/util.c1
3 files changed, 5 insertions, 3 deletions
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 7ef558c4..36ad6242 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -1026,7 +1026,7 @@ static int check_validity(alpm_handle_t *handle,
v->siglevel & ALPM_SIG_PACKAGE_OPTIONAL,
v->siglevel & ALPM_SIG_PACKAGE_MARGINAL_OK,
v->siglevel & ALPM_SIG_PACKAGE_UNKNOWN_OK);
- /* fallthrough */
+ __attribute__((fallthrough));
case ALPM_ERR_PKG_INVALID_CHECKSUM:
prompt_to_delete(handle, v->path, v->error);
break;
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 7e810127..e398855a 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -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(_(" --ignoregroup <grp>\n"
" ignore a group upgrade (can be used more than once)\n"));
- /* fall through */
+ __attribute__((fallthrough));
case PM_OP_REMOVE:
addlist(_(" -d, --nodeps skip dependency version checks (-dd to skip all checks)\n"));
addlist(_(" --assume-installed <package=version>\n"
@@ -412,7 +412,8 @@ static int parsearg_global(int opt)
unsigned short debug = (unsigned short)atoi(optarg);
switch(debug) {
case 2:
- config->logmask |= ALPM_LOG_FUNCTION; /* fall through */
+ config->logmask |= ALPM_LOG_FUNCTION;
+ __attribute__((fallthrough));
case 1:
config->logmask |= ALPM_LOG_DEBUG;
break;
diff --git a/src/pacman/util.c b/src/pacman/util.c
index 59d6a72e..5486e7a5 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -1069,6 +1069,7 @@ static char *pkg_get_location(alpm_pkg_t *pkg)
}
/* fallthrough - for theoretical serverless repos */
+ __attribute__((fallthrough));
case ALPM_PKG_FROM_FILE:
return strdup(alpm_pkg_get_filename(pkg));