This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=b95c96c278860fd3020ee378c5bcbf829f985756

commit b95c96c278860fd3020ee378c5bcbf829f985756
Author: Guillem Jover <[email protected]>
AuthorDate: Thu Feb 23 20:14:00 2023 +0100

    lib, src, utils: Use new enum flag C attributes
    
    Warned-by: clang-16 -Wassign-enum
    Changelog: internal
---
 lib/dpkg/atomic-file.h      | 2 +-
 lib/dpkg/c-ctype.h          | 2 +-
 lib/dpkg/debug.h            | 2 +-
 lib/dpkg/dpkg-db.h          | 6 +++---
 lib/dpkg/fsys.h             | 4 ++--
 lib/dpkg/parsedump.h        | 2 +-
 lib/dpkg/pkg-spec.h         | 2 +-
 lib/dpkg/subproc.h          | 2 +-
 lib/dpkg/treewalk.h         | 2 +-
 lib/dpkg/trigdeferred.h     | 2 +-
 lib/dpkg/version.h          | 2 +-
 src/common/force.h          | 2 +-
 src/deb/dpkg-deb.h          | 2 +-
 src/main/configure.c        | 2 +-
 utils/start-stop-daemon.c   | 2 +-
 utils/update-alternatives.c | 2 +-
 16 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/lib/dpkg/atomic-file.h b/lib/dpkg/atomic-file.h
index 54ceea1e6..17467ae1b 100644
--- a/lib/dpkg/atomic-file.h
+++ b/lib/dpkg/atomic-file.h
@@ -33,7 +33,7 @@ DPKG_BEGIN_DECLS
  * @{
  */
 
-enum atomic_file_flags {
+enum DPKG_ATTR_ENUM_FLAGS atomic_file_flags {
        ATOMIC_FILE_NORMAL      = 0,
        ATOMIC_FILE_BACKUP      = DPKG_BIT(0),
        ATOMIC_FILE_MKPATH      = DPKG_BIT(1),
diff --git a/lib/dpkg/c-ctype.h b/lib/dpkg/c-ctype.h
index b04fda86b..a08d852cb 100644
--- a/lib/dpkg/c-ctype.h
+++ b/lib/dpkg/c-ctype.h
@@ -29,7 +29,7 @@ DPKG_BEGIN_DECLS
 
 #define C_CTYPE_BIT(bit)       (1 << (bit))
 
-enum c_ctype_bit {
+enum DPKG_ATTR_ENUM_FLAGS c_ctype_bit {
        C_CTYPE_BLANK = C_CTYPE_BIT(0),
        C_CTYPE_WHITE = C_CTYPE_BIT(1),
        C_CTYPE_SPACE = C_CTYPE_BIT(2),
diff --git a/lib/dpkg/debug.h b/lib/dpkg/debug.h
index c276ec57e..be4efacfa 100644
--- a/lib/dpkg/debug.h
+++ b/lib/dpkg/debug.h
@@ -38,7 +38,7 @@ DPKG_BEGIN_DECLS
  * XXX: We do not use DPKG_BIT() here, because the octal values are part
  * of the current output interface.
  */
-enum debugflags {
+enum DPKG_ATTR_ENUM_FLAGS debugflags {
        dbg_general = 01,
        dbg_scripts = 02,
        dbg_eachfile = 010,
diff --git a/lib/dpkg/dpkg-db.h b/lib/dpkg/dpkg-db.h
index 2cd2c5690..61f220506 100644
--- a/lib/dpkg/dpkg-db.h
+++ b/lib/dpkg/dpkg-db.h
@@ -263,7 +263,7 @@ char *dpkg_db_get_path(const char *pathpart);
 
 /*** from dbmodify.c ***/
 
-enum modstatdb_rw {
+enum DPKG_ATTR_ENUM_FLAGS modstatdb_rw {
   msdbrw_unset                 = -1,
 
   /* Those marked with «return» are possible returns from modstatdb_open(). */
@@ -332,7 +332,7 @@ pkg_hash_report(FILE *);
 
 /*** from parse.c ***/
 
-enum parsedbflags {
+enum DPKG_ATTR_ENUM_FLAGS parsedbflags {
   /** Parse a single control stanza. */
   pdb_single_stanza            = DPKG_BIT(0),
   /** Store in ‘available’ in-core structures, not ‘status’. */
@@ -461,7 +461,7 @@ void
 write_stanza(FILE *, const char *,
              const struct pkginfo *, const struct pkgbin *);
 
-enum writedb_flags {
+enum DPKG_ATTR_ENUM_FLAGS writedb_flags {
   /** No flags. */
   wdb_none                     = 0,
   /** Dump ‘available’ in-core structures, not ‘status’. */
diff --git a/lib/dpkg/fsys.h b/lib/dpkg/fsys.h
index 10aae092e..2f52250bb 100644
--- a/lib/dpkg/fsys.h
+++ b/lib/dpkg/fsys.h
@@ -53,7 +53,7 @@ struct pkginfo;
 /**
  * Flags to fsys_hash_find_node().
  */
-enum fsys_hash_find_flags {
+enum DPKG_ATTR_ENUM_FLAGS fsys_hash_find_flags {
        /** No flags. */
        FHFF_NONE                       = 0,
        /** Do not need to copy filename. */
@@ -62,7 +62,7 @@ enum fsys_hash_find_flags {
        FHFF_NONEW                      = DPKG_BIT(1),
 };
 
-enum fsys_namenode_flags {
+enum DPKG_ATTR_ENUM_FLAGS fsys_namenode_flags {
        /** No flags. */
        FNNF_NONE                       = 0,
        /** In the newconffiles list. */
diff --git a/lib/dpkg/parsedump.h b/lib/dpkg/parsedump.h
index 35dc5fde2..4f03e87f7 100644
--- a/lib/dpkg/parsedump.h
+++ b/lib/dpkg/parsedump.h
@@ -118,7 +118,7 @@ freadfunction f_architecture;
 freadfunction f_trigpend, f_trigaw;
 freadfunction f_archives;
 
-enum fwriteflags {
+enum DPKG_ATTR_ENUM_FLAGS fwriteflags {
        /** No flags. */
        fw_none                 = 0,
        /** Print field header and trailing newline. */
diff --git a/lib/dpkg/pkg-spec.h b/lib/dpkg/pkg-spec.h
index af05d9d1c..5415d8508 100644
--- a/lib/dpkg/pkg-spec.h
+++ b/lib/dpkg/pkg-spec.h
@@ -38,7 +38,7 @@ DPKG_BEGIN_DECLS
  * @{
  */
 
-enum pkg_spec_flags {
+enum DPKG_ATTR_ENUM_FLAGS pkg_spec_flags {
        /** Recognize glob patterns. */
        PKG_SPEC_PATTERNS       = DPKG_BIT(0),
 
diff --git a/lib/dpkg/subproc.h b/lib/dpkg/subproc.h
index 8e5d64336..4bdf9f228 100644
--- a/lib/dpkg/subproc.h
+++ b/lib/dpkg/subproc.h
@@ -33,7 +33,7 @@ DPKG_BEGIN_DECLS
  * @{
  */
 
-enum subproc_flags {
+enum DPKG_ATTR_ENUM_FLAGS subproc_flags {
        /** Default subprocess flags. */
        SUBPROC_NORMAL          = 0,
        /** Emit a warning instead of an error. */
diff --git a/lib/dpkg/treewalk.h b/lib/dpkg/treewalk.h
index ef72229f4..16b7a310c 100644
--- a/lib/dpkg/treewalk.h
+++ b/lib/dpkg/treewalk.h
@@ -36,7 +36,7 @@ DPKG_BEGIN_DECLS
  * @{
  */
 
-enum treewalk_options {
+enum DPKG_ATTR_ENUM_FLAGS treewalk_options {
        TREEWALK_NONE = 0,
        TREEWALK_FORCE_STAT = DPKG_BIT(0),
        TREEWALK_FOLLOW_LINKS = DPKG_BIT(1),
diff --git a/lib/dpkg/trigdeferred.h b/lib/dpkg/trigdeferred.h
index c353ca150..3832334f2 100644
--- a/lib/dpkg/trigdeferred.h
+++ b/lib/dpkg/trigdeferred.h
@@ -33,7 +33,7 @@ DPKG_BEGIN_DECLS
  * @{
  */
 
-enum trigdef_update_flags {
+enum DPKG_ATTR_ENUM_FLAGS trigdef_update_flags {
        TDUF_NO_LOCK_OK         = DPKG_BIT(0),
        TDUF_WRITE              = DPKG_BIT(1),
        TDUF_NO_LOCK            = TDUF_NO_LOCK_OK | TDUF_WRITE,
diff --git a/lib/dpkg/version.h b/lib/dpkg/version.h
index cbc76077b..7c3f0275e 100644
--- a/lib/dpkg/version.h
+++ b/lib/dpkg/version.h
@@ -61,7 +61,7 @@ struct dpkg_version {
  * Enum constants for the supported relation operations that can be done
  * on Debian versions.
  */
-enum dpkg_relation {
+enum DPKG_ATTR_ENUM_FLAGS dpkg_relation {
        /** The “none” relation, sentinel value. */
        DPKG_RELATION_NONE      = 0,
        /** Equality relation (‘=’). */
diff --git a/src/common/force.h b/src/common/force.h
index 25a42fc25..c232c7f8c 100644
--- a/src/common/force.h
+++ b/src/common/force.h
@@ -25,7 +25,7 @@
 #include <dpkg/dpkg.h>
 #include <dpkg/options.h>
 
-enum force_flags {
+enum DPKG_ATTR_ENUM_FLAGS force_flags {
        FORCE_ARCHITECTURE = DPKG_BIT(0),
        FORCE_BAD_PATH = DPKG_BIT(1),
        FORCE_BAD_VERIFY = DPKG_BIT(2),
diff --git a/src/deb/dpkg-deb.h b/src/deb/dpkg-deb.h
index d06e37bd1..c93f07750 100644
--- a/src/deb/dpkg-deb.h
+++ b/src/deb/dpkg-deb.h
@@ -45,7 +45,7 @@ extern const char *opt_showformat;
 
 extern struct deb_version deb_format;
 
-enum dpkg_tar_options {
+enum DPKG_ATTR_ENUM_FLAGS dpkg_tar_options {
        /** Output the tar file directly, without any processing. */
        DPKG_TAR_PASSTHROUGH = 0,
        /** List tar files. */
diff --git a/src/main/configure.c b/src/main/configure.c
index 14f300bd7..14bac534e 100644
--- a/src/main/configure.c
+++ b/src/main/configure.c
@@ -58,7 +58,7 @@
 
 #include "main.h"
 
-enum conffopt {
+enum DPKG_ATTR_ENUM_FLAGS conffopt {
        CFOF_PROMPT             = DPKG_BIT(0),
        CFOF_KEEP               = DPKG_BIT(1),
        CFOF_INSTALL            = DPKG_BIT(2),
diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c
index 69db4995e..f70cc379b 100644
--- a/utils/start-stop-daemon.c
+++ b/utils/start-stop-daemon.c
@@ -190,7 +190,7 @@ enum action_code {
        ACTION_STATUS,
 };
 
-enum match_code {
+enum LIBCOMPAT_ATTR_ENUM_FLAGS match_code {
        MATCH_NONE      = 0,
        MATCH_PID       = 1 << 0,
        MATCH_PPID      = 1 << 1,
diff --git a/utils/update-alternatives.c b/utils/update-alternatives.c
index 26e165b16..77a1c5598 100644
--- a/utils/update-alternatives.c
+++ b/utils/update-alternatives.c
@@ -1255,7 +1255,7 @@ alternative_remove_choice(struct alternative *a, const 
char *file)
  * Alternatives Database Load/Store functions.
  */
 
-enum altdb_flags {
+enum LIBCOMPAT_ATTR_ENUM_FLAGS altdb_flags {
        ALTDB_LAX_PARSER = 1 << 0,
        ALTDB_WARN_PARSER = 1 << 1,
 };

-- 
Dpkg.Org's dpkg

Reply via email to