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=fc44e9edd298fc9fb637ed937c92f81f4fcc0084

commit fc44e9edd298fc9fb637ed937c92f81f4fcc0084
Author: Guillem Jover <[email protected]>
AuthorDate: Fri Dec 23 22:45:53 2022 +0100

    lib: Use __name__ format for attributes
    
    This should reduce the chance of misbehavior due to symbol collision
    from unexpected macro definitions on users including these headers.
---
 lib/compat/compat.h | 10 +++++-----
 lib/dpkg/macros.h   | 22 +++++++++++-----------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/lib/compat/compat.h b/lib/compat/compat.h
index cad295ca7..5c99bc5f5 100644
--- a/lib/compat/compat.h
+++ b/lib/compat/compat.h
@@ -48,9 +48,9 @@
 #endif
 
 #if LIBCOMPAT_GCC_VERSION >= 0x0300
-#define LIBCOMPAT_ATTR_FMT(t, f, a)    __attribute__((format(t, f, a)))
-#define LIBCOMPAT_ATTR_PRINTF(n)       LIBCOMPAT_ATTR_FMT(printf, n, n + 1)
-#define LIBCOMPAT_ATTR_VPRINTF(n)      LIBCOMPAT_ATTR_FMT(printf, n, 0)
+#define LIBCOMPAT_ATTR_FMT(t, f, a)    __attribute__((__format__(t, f, a)))
+#define LIBCOMPAT_ATTR_PRINTF(n)       LIBCOMPAT_ATTR_FMT(__printf__, n, n + 1)
+#define LIBCOMPAT_ATTR_VPRINTF(n)      LIBCOMPAT_ATTR_FMT(__printf__, n, 0)
 #else
 #define LIBCOMPAT_ATTR_FMT(t, f, a)
 #define LIBCOMPAT_ATTR_PRINTF(n)
@@ -58,13 +58,13 @@
 #endif
 
 #if LIBCOMPAT_GCC_VERSION >= 0x0300
-#define LIBCOMPAT_ATTR_NORET           __attribute__((noreturn))
+#define LIBCOMPAT_ATTR_NORET           __attribute__((__noreturn__))
 #else
 #define LIBCOMPAT_ATTR_NORET
 #endif
 
 #if LIBCOMPAT_GCC_VERSION >= 0x0400
-#define LIBCOMPAT_ATTR_SENTINEL                __attribute__((sentinel))
+#define LIBCOMPAT_ATTR_SENTINEL                __attribute__((__sentinel__))
 #else
 #define LIBCOMPAT_ATTR_SENTINEL
 #endif
diff --git a/lib/dpkg/macros.h b/lib/dpkg/macros.h
index c85885440..241f7e29f 100644
--- a/lib/dpkg/macros.h
+++ b/lib/dpkg/macros.h
@@ -40,39 +40,39 @@
 #endif
 
 #if DPKG_GCC_VERSION >= 0x0300
-#define DPKG_ATTR_UNUSED       __attribute__((unused))
+#define DPKG_ATTR_UNUSED       __attribute__((__unused__))
 #else
 #define DPKG_ATTR_UNUSED
 #endif
 
 #if DPKG_GCC_VERSION >= 0x0300
-#define DPKG_ATTR_CONST                __attribute__((const))
+#define DPKG_ATTR_CONST                __attribute__((__const__))
 #else
 #define DPKG_ATTR_CONST
 #endif
 
 #if DPKG_GCC_VERSION >= 0x0300
-#define DPKG_ATTR_PURE         __attribute__((pure))
+#define DPKG_ATTR_PURE         __attribute__((__pure__))
 #else
 #define DPKG_ATTR_PURE
 #endif
 
 #if DPKG_GCC_VERSION >= 0x0300
-#define DPKG_ATTR_MALLOC       __attribute__((malloc))
+#define DPKG_ATTR_MALLOC       __attribute__((__malloc__))
 #else
 #define DPKG_ATTR_MALLOC
 #endif
 
 #if DPKG_GCC_VERSION >= 0x0300
-#define DPKG_ATTR_NORET                __attribute__((noreturn))
+#define DPKG_ATTR_NORET                __attribute__((__noreturn__))
 #else
 #define DPKG_ATTR_NORET
 #endif
 
 #if DPKG_GCC_VERSION >= 0x0300
-#define DPKG_ATTR_FMT(t, f, a) __attribute__((format(t, f, a)))
-#define DPKG_ATTR_PRINTF(n)    DPKG_ATTR_FMT(printf, n, n + 1)
-#define DPKG_ATTR_VPRINTF(n)   DPKG_ATTR_FMT(printf, n, 0)
+#define DPKG_ATTR_FMT(t, f, a) __attribute__((__format__(t, f, a)))
+#define DPKG_ATTR_PRINTF(n)    DPKG_ATTR_FMT(__printf__, n, n + 1)
+#define DPKG_ATTR_VPRINTF(n)   DPKG_ATTR_FMT(__printf__, n, 0)
 #else
 #define DPKG_ATTR_FMT(t, f, a)
 #define DPKG_ATTR_PRINTF(n)
@@ -80,19 +80,19 @@
 #endif
 
 #if DPKG_GCC_VERSION > 0x0302
-#define DPKG_ATTR_NONNULL(...) __attribute__((nonnull(__VA_ARGS__)))
+#define DPKG_ATTR_NONNULL(...) __attribute__((__nonnull__(__VA_ARGS__)))
 #else
 #define DPKG_ATTR_NONNULL(...)
 #endif
 
 #if DPKG_GCC_VERSION > 0x0302
-#define DPKG_ATTR_REQRET       __attribute__((warn_unused_result))
+#define DPKG_ATTR_REQRET       __attribute__((__warn_unused_result__))
 #else
 #define DPKG_ATTR_REQRET
 #endif
 
 #if DPKG_GCC_VERSION >= 0x0400
-#define DPKG_ATTR_SENTINEL     __attribute__((sentinel))
+#define DPKG_ATTR_SENTINEL     __attribute__((__sentinel__))
 #else
 #define DPKG_ATTR_SENTINEL
 #endif

-- 
Dpkg.Org's dpkg

Reply via email to