Browse Source

opt: Silence unsed param warning triggered by -Wextra

The type checking function does not use its parameter:

    ccan/opt/opt.h: In function ‘_check_is_entry’:
        ccan/opt/opt.h:328:53: warning: unused parameter ‘e’

Annotate the function using UNUSED from compiler.h.  This commit also
adds compiler.h as a dependency for opt.
Joel Stanley 15 years ago
parent
commit
59d2b90f59
2 changed files with 3 additions and 1 deletions
  1. 1 0
      ccan/opt/_info
  2. 2 1
      ccan/opt/opt.h

+ 1 - 0
ccan/opt/_info

@@ -59,6 +59,7 @@ int main(int argc, char *argv[])
 
 
 	if (strcmp(argv[1], "depends") == 0) {
 	if (strcmp(argv[1], "depends") == 0) {
 		printf("ccan/typesafe_cb\n");
 		printf("ccan/typesafe_cb\n");
+		printf("ccan/compiler\n");
 		return 0;
 		return 0;
 	}
 	}
 
 

+ 2 - 1
ccan/opt/opt.h

@@ -1,5 +1,6 @@
 #ifndef CCAN_OPT_H
 #ifndef CCAN_OPT_H
 #define CCAN_OPT_H
 #define CCAN_OPT_H
+#include <ccan/compiler/compiler.h>
 #include <ccan/typesafe_cb/typesafe_cb.h>
 #include <ccan/typesafe_cb/typesafe_cb.h>
 #include <stdbool.h>
 #include <stdbool.h>
 
 
@@ -325,6 +326,6 @@ void _opt_register(const char *names, enum opt_type type,
 		   void *arg, const char *desc);
 		   void *arg, const char *desc);
 
 
 /* We use this to get typechecking for OPT_SUBTABLE */
 /* We use this to get typechecking for OPT_SUBTABLE */
-static inline int _check_is_entry(struct opt_table *e) { return 0; }
+static inline int _check_is_entry(struct opt_table *e UNUSED) { return 0; }
 
 
 #endif /* CCAN_OPT_H */
 #endif /* CCAN_OPT_H */