Bug 1273 - cachedb.c doesn't compile with -Wextra
cachedb.c doesn't compile with -Wextra
Product: unbound
Classification: Unclassified
Component: server
Other All
: P5 enhancement
Assigned To: unbound team
Depends on:
  Show dependency treegraph
Reported: 2017-05-31 00:12 CEST by JINMEI Tatuya
Modified: 2017-05-31 07:43 CEST (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
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