From 9bb29ef377845e8de08a8502b05799a32bbb0d84 Mon Sep 17 00:00:00 2001 From: Adam Heath Date: Sun, 19 May 2002 07:42:58 +0000 Subject: [PATCH] Define an UNUSED macro for __attribute((unused))__. --- ChangeLog | 5 +++++ config.h.bot | 12 ++++++++++++ configure.in | 5 +++++ optlib/getopt.c | 2 +- 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 753ff5e2..35027398 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun May 19 02:31:11 CDT 2002 Adam Heath + + * config.h.bot, configure.in, optlib/getopt.c: Define an UNUSED macro, + for __attribute__((unused)). + Sun May 19 02:31:11 CDT 2002 Adam Heath * optlib/error.h, optlib/getopt.c, utils/start-stop-daemon.c: Use diff --git a/config.h.bot b/config.h.bot index 305be866..5f68445b 100644 --- a/config.h.bot +++ b/config.h.bot @@ -78,6 +78,18 @@ #define CONSTANT FUNCATTR((ATTRCONST)) #endif +/* GNU C unused functions, or null. */ +#ifndef ATTRUNUSED +#ifdef HAVE_GNUC25_UNUSED +#define ATTRUNUSED +#else +#define ATTRUNUSED +#endif +#endif +#ifndef UNUSED +#define UNUSED FUNCATTR((ATTRUNUSED)) +#endif + /* Declare strerror if we don't have it already. */ #ifndef HAVE_STRERROR const char *strerror(int); diff --git a/configure.in b/configure.in index fa8883b5..bfb36832 100644 --- a/configure.in +++ b/configure.in @@ -203,6 +203,11 @@ DPKG_CACHED_TRY_COMPILE(__attribute__((,,)),dpkg_cv_c_attribute_supported,, AC_MSG_RESULT(yes) AC_DEFINE(HAVE_GNUC25_CONST), AC_MSG_RESULT(no)) + DPKG_CACHED_TRY_COMPILE(__attribute__((unused)),dpkg_cv_c_attribute_unused,, + [extern int testfunction(int x) __attribute__((unused))], + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_GNUC25_UNUSED), + AC_MSG_RESULT(no)) DPKG_CACHED_TRY_COMPILE(__attribute__((format...)),dpkg_cv_attribute_format,, [extern int testfunction(char *y, ...) __attribute__((format(printf,1,2)))], AC_MSG_RESULT(yes) diff --git a/optlib/getopt.c b/optlib/getopt.c index 900ae922..ea2d1ff5 100644 --- a/optlib/getopt.c +++ b/optlib/getopt.c @@ -270,7 +270,7 @@ extern pid_t __libc_pid; is valid for the getopt call we must make sure that the ARGV passed to getopt is that one passed to the process. */ static void -FUNCATTR(unused) +UNUSED store_args_and_env (int argc, char *const *argv) { /* XXX This is no good solution. We should rather copy the args so -- 2.39.5