summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b4a7a10)
The defines can help the compiler to produce better warnings
and errors.
This is manual cherrypicked from nmh
*/
#if __GNUC__ > 2
# define NORETURN __attribute__((__noreturn__))
*/
#if __GNUC__ > 2
# define NORETURN __attribute__((__noreturn__))
+# define CONST __attribute__((const))
+# define MALLOC __attribute__((malloc))
+# define NONNULL(...) __attribute__((nonnull(__VA_ARGS__)))
+# define PURE __attribute__((pure))
+# define ENDNULL __attribute__((sentinel))
+# define CONST
+# define MALLOC
+# define NONNULL(...)
+# define PURE
+# define ENDNULL
+#endif
+
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+# define ALLOC_SIZE(...) __attribute__((alloc_size(__VA_ARGS__)))
+# define CHECK_PRINTF(fmt, arg) __attribute__((format(printf, fmt, arg)))
+#else
+# define ALLOC_SIZE(...)
+# define CHECK_PRINTF(fmt, arg)