aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlaf Meeuwissen <paddy-hack@member.fsf.org>2016-09-04 12:50:19 +0900
committerOlaf Meeuwissen <paddy-hack@member.fsf.org>2016-09-04 12:50:19 +0900
commit23f052113b5567033da0d9c4679451d97c484220 (patch)
tree355a83ad1415bb0563d986abb20a663b5476030e
parent0d527f6659e06175d855aaa1a70fc2be52aad1a7 (diff)
saned: fix [-Wunused-parameter] compiler warning
The `__sane_unused__` attribute has been moved from sanei_backend.h to sanei.h to make it generally useful instead of limited to backends.
-rw-r--r--frontend/saned.c2
-rw-r--r--include/sane/sanei.h11
-rw-r--r--include/sane/sanei_backend.h14
3 files changed, 12 insertions, 15 deletions
diff --git a/frontend/saned.c b/frontend/saned.c
index 5b28be4..0aba175 100644
--- a/frontend/saned.c
+++ b/frontend/saned.c
@@ -3181,7 +3181,7 @@ run_standalone (char *user)
static void
-run_inetd (char *sock)
+run_inetd (char __sane_unused__ *sock)
{
int fd = -1;
diff --git a/include/sane/sanei.h b/include/sane/sanei.h
index ece1beb..9458f34 100644
--- a/include/sane/sanei.h
+++ b/include/sane/sanei.h
@@ -92,6 +92,9 @@
/** @name Public macros and functions
* @{
*/
+/** @def __sane_unused__
+ * Mark parameters as potentially unused.
+ */
/** @def STRINGIFY(x)
* Turn parameter into string.
*/
@@ -137,6 +140,14 @@
/* @} */
/* A few convenience macros: */
+
+/** @hideinitializer */
+#ifdef __GNUC__
+#define __sane_unused__ __attribute__((unused))
+#else
+#define __sane_unused__
+#endif
+
/** @hideinitializer */
#define NELEMS(a) ((int)(sizeof (a) / sizeof (a[0])))
diff --git a/include/sane/sanei_backend.h b/include/sane/sanei_backend.h
index 0a9a812..8273e88 100644
--- a/include/sane/sanei_backend.h
+++ b/include/sane/sanei_backend.h
@@ -9,20 +9,6 @@
*/
-/*
- * Compiler related options
- */
-
-/** Mark unused variables/parameters
- *
- * Tells the compiler a variable is unused, so the compiler doesn't spit a warning.
- */
-#ifdef __GNUC__
-#define __sane_unused__ __attribute__((unused))
-#else
-#define __sane_unused__
-#endif
-
/** @name Compatibility macros
* @{
*/