The following commit has been merged in the master branch:
commit 7d4d1007c4f7ca8d40a5374f1305426b8c1e2e54
Author: Guillem Jover <[email protected]>
Date:   Sun Oct 31 04:05:19 2010 +0100

    libdpkg: Add PURE, MALLOC, NONNULL and REQRET compiler attributes

diff --git a/lib/dpkg/macros.h b/lib/dpkg/macros.h
index 76f2de7..a9f8612 100644
--- a/lib/dpkg/macros.h
+++ b/lib/dpkg/macros.h
@@ -30,17 +30,30 @@
 #if defined(__GNUC__) && (__GNUC__ >= 3)
 #define DPKG_ATTR_UNUSED       __attribute__((unused))
 #define DPKG_ATTR_CONST                __attribute__((const))
+#define DPKG_ATTR_PURE         __attribute__((pure))
+#define DPKG_ATTR_MALLOC       __attribute__((malloc))
 #define DPKG_ATTR_NORET                __attribute__((noreturn))
 #define DPKG_ATTR_PRINTF(n)    __attribute__((format(printf, n, n + 1)))
 #define DPKG_ATTR_VPRINTF(n)   __attribute__((format(printf, n, 0)))
 #else
 #define DPKG_ATTR_UNUSED
 #define DPKG_ATTR_CONST
+#define DPKG_ATTR_PURE
+#define DPKG_ATTR_MALLOC
 #define DPKG_ATTR_NORET
 #define DPKG_ATTR_PRINTF(n)
 #define DPKG_ATTR_VPRINTF(n)
 #endif
 
+#if defined(__GNUC__) && \
+    ((__GNUC__ == 3 && __GNUC_MINOR__ > 2) || __GNUC__ >= 4)
+#define DPKG_ATTR_NONNULL(...) __attribute__((nonnull(__VA_ARGS__)))
+#define DPKG_ATTR_REQRET       __attribute__((warn_unused_result))
+#else
+#define DPKG_ATTR_NONNULL(...)
+#define DPKG_ATTR_REQRET
+#endif
+
 #if defined(__GNUC__) && (__GNUC__ >= 4)
 #define DPKG_ATTR_SENTINEL     __attribute__((sentinel))
 #else

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to