summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2022-01-01 02:14:14 +0000
committerColin Watson <cjwatson@debian.org>2022-01-01 02:14:14 +0000
commit5c28907556920624e6a257b1aeaaa91501306ed8 (patch)
tree6962d854b1c069350dcf090ddbfe22917ca5bcdd /include
parentc4ef5112a240de1681c74e4c6b64939090fe0193 (diff)
Simplify some GCC attribute handling
* include/manconfig.h.in (ATTRIBUTE_FORMAT_PRINTF, ATTRIBUTE_WARN_UNUSED_RESULT, ATTRIBUTE_SENTINEL): Remove in favour of Gnulib-provided macros. (create_tempdir, appendstr): Use _GL_ATTRIBUTE_NODISCARD rather than ATTRIBUTE_WARN_UNUSED_RESULT. (debug, debug_error): Use _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM rather than ATTRIBUTE_FORMAT_PRINTF. (appendstr): Use _GL_ATTRIBUTE_SENTINEL rather than ATTRIBUTE_SENTINEL. * lib/debug.c (vdebug): Use _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM rather than ATTRIBUTE_FORMAT_PRINTF.
Diffstat (limited to 'include')
-rw-r--r--include/manconfig.h.in32
1 files changed, 5 insertions, 27 deletions
diff --git a/include/manconfig.h.in b/include/manconfig.h.in
index 552b5f6c..95fe4d0a 100644
--- a/include/manconfig.h.in
+++ b/include/manconfig.h.in
@@ -245,28 +245,6 @@
# define GNUC_PREREQ(maj,min) 0
#endif
-/* Does this compiler support format string checking? */
-#if GNUC_PREREQ(2,0)
-# define ATTRIBUTE_FORMAT_PRINTF(a,b) \
- __attribute__ ((__format__ (__printf__, a, b)))
-#else
-# define ATTRIBUTE_FORMAT_PRINTF(a,b)
-#endif
-
-/* Does this compiler support unused result checking? */
-#if GNUC_PREREQ(3,4)
-# define ATTRIBUTE_WARN_UNUSED_RESULT __attribute__ ((__warn_unused_result__))
-#else
-# define ATTRIBUTE_WARN_UNUSED_RESULT
-#endif
-
-/* Does this compiler support sentinel checking? */
-#if GNUC_PREREQ(4,0)
-# define ATTRIBUTE_SENTINEL __attribute__ ((__sentinel__))
-#else
-# define ATTRIBUTE_SENTINEL
-#endif
-
/* If running checker, support the garbage detector, else don't */
#ifdef __CHECKER__
extern void __chkr_garbage_detector (void);
@@ -309,14 +287,14 @@ extern struct compression comp_list[];
#include <stddef.h> /* for size_t */
#include "xalloc.h"
#include "xstrndup.h"
-extern char *create_tempdir (const char *template)
- ATTRIBUTE_WARN_UNUSED_RESULT;
+extern char *create_tempdir (const char *template) _GL_ATTRIBUTE_NODISCARD;
extern bool debug_level; /* shows whether -d issued */
extern void init_debug (void);
-extern void debug (const char *message, ...) ATTRIBUTE_FORMAT_PRINTF(1, 2);
+extern void debug (const char *message, ...)
+ _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 2);
extern void debug_error (const char *message, ...)
- ATTRIBUTE_FORMAT_PRINTF(1, 2);
+ _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 2);
struct pipeline;
@@ -344,7 +322,7 @@ extern char *lang_dir (const char *filename);
extern void init_locale (void);
extern char *appendstr (char *, ...)
- ATTRIBUTE_SENTINEL ATTRIBUTE_WARN_UNUSED_RESULT;
+ _GL_ATTRIBUTE_SENTINEL () _GL_ATTRIBUTE_NODISCARD;
extern int quiet; /* be quiet(er) if 1 */