Fix more clang warnings.
authorEmil Mikulic <emikulic@gmail.com>
Sat, 25 Jan 2014 09:08:21 +0000 (20:08 +1100)
committerEmil Mikulic <emikulic@gmail.com>
Sat, 25 Jan 2014 14:07:28 +0000 (01:07 +1100)
dev_clang_warns.sh
dns.c
ncache.c

index 9ddb772..7dc2bc5 100755 (executable)
@@ -9,4 +9,4 @@ LLVM=$HOME/llvm
 CLANG=$LLVM/install/bin/clang
 
 $CLANG -Weverything -Wno-padded -Wno-format-non-iso -Wno-cast-align \
-  -Wno-disabled-macro-expansion -O -c $TARGET
+  -Wno-disabled-macro-expansion -Wno-used-but-marked-unused -O -c $TARGET
diff --git a/dns.c b/dns.c
index 49a49c2..f4cb129 100644 (file)
--- a/dns.c
+++ b/dns.c
@@ -111,12 +111,7 @@ tree_cmp(struct tree_rec *a, struct tree_rec *b)
 }
 
 static RB_HEAD(tree_t, tree_rec) ip_tree = RB_INITIALIZER(&tree_rec);
-/* Quiet warnings. */
-static struct tree_rec * tree_t_RB_NEXT(struct tree_rec *elm)
-   _unused_;
-static struct tree_rec * tree_t_RB_MINMAX(struct tree_t *head, int val)
-   _unused_;
-RB_GENERATE(tree_t, tree_rec, ptree, tree_cmp)
+RB_GENERATE_STATIC(tree_t, tree_rec, ptree, tree_cmp)
 
 void
 dns_queue(const struct addr *const ipaddr)
index 96e052f..640653c 100644 (file)
--- a/ncache.c
+++ b/ncache.c
@@ -33,7 +33,7 @@ rec_cmp(struct name_rec *a, struct name_rec *b)
 }
 
 RB_HEAD(nc_tree, name_rec);
-RB_GENERATE(nc_tree, name_rec, ptree, rec_cmp)
+RB_GENERATE_STATIC(nc_tree, name_rec, ptree, rec_cmp)
 
 static struct nc_tree
    t_proto   = RB_INITIALIZER(&name_rec),