Bug 1273

Summary: cachedb.c doesn't compile with -Wextra
Product: unbound Reporter: JINMEI Tatuya <jtatuya>
Component: serverAssignee: unbound team <unbound-team>
Status: RESOLVED FIXED    
Severity: enhancement CC: cathya, wouter
Priority: P5    
Version: unspecified   
Hardware: Other   
OS: All   

Description JINMEI Tatuya 2017-05-31 00:12:59 CEST
As of revision 4199, cachedb/cachedb.c doesn't compile with -Wall -Wextra
-Werror with my compiler (gcc version 5.4.0 20160609
(Ubuntu 5.4.0-6ubuntu1~16.04.2)):

cachedb/cachedb.c: In function ‘cachedb_apply_cfg’:
cachedb/cachedb.c:171:72: error: unused parameter ‘cfg’ [-Werror=unused-parameter]
 cachedb_apply_cfg(struct cachedb_env* cachedb_env, struct config_file* cfg)
                                                                        ^
cc1: all warnings being treated as errors

This can be prevented with the following trivial patch:

Index: cachedb/cachedb.c
===================================================================
--- cachedb/cachedb.c	(revision 4199)
+++ cachedb/cachedb.c	(working copy)
@@ -171,6 +171,7 @@
 cachedb_apply_cfg(struct cachedb_env* cachedb_env, struct config_file* cfg)
 {
 	const char* backend_str = "testframe"; /* TODO get from cfg */
+	(void)cfg;	 /* need this until the TODO is implemented */
 	if(backend_str && backend_str[0]) {
 		cachedb_env->backend = cachedb_find_backend(backend_str);
 		if(!cachedb_env->backend) {
Comment 1 Wouter Wijngaards 2017-05-31 07:43:15 CEST
Hi Jinmei,

Of course, I have applied the patch.

Best regards, Wouter