Skip to content

Commit 81ad466

Browse files
author
zc-read-impl-leader
committed
fix(ff_config): cast const log.dir on free to satisfy -Werror lib build
ff_global_cfg.log.dir is 'const char *' (ff_config.h:323); the cleanup frees added in ca83653 trigger -Werror=discarded-qualifiers under the lib Makefile's -Werror, breaking the whole lib build. Cast to (void*) at the two free sites (L970 ini handler replace, L1676 ff_unload_config). No behavior change. Unblocks the build for ZC-RECV work.
1 parent e62afc5 commit 81ad466

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/ff_config.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ ini_parse_handler(void* user, const char* section, const char* name,
967967
pconfig->log.level = atoi(value);
968968
} else if (MATCH("dpdk", "fstack_log_file_prefix")) {
969969
/* default_config strdup'd the default; free it before overwrite. */
970-
if (pconfig->log.dir) free(pconfig->log.dir);
970+
if (pconfig->log.dir) free((void *)pconfig->log.dir);
971971
pconfig->log.dir = strdup(value);
972972
} else if (MATCH("dpdk", "channel")) {
973973
pconfig->dpdk.nb_channel = atoi(value);
@@ -1673,7 +1673,7 @@ ff_unload_config(void)
16731673
* That overwrite leak is fixed by the strdup_replace pattern in
16741674
* ini_parse_handler -- here we just free whatever heap pointer survives. */
16751675
if (ff_global_cfg.log.dir) {
1676-
free(ff_global_cfg.log.dir);
1676+
free((void *)ff_global_cfg.log.dir);
16771677
ff_global_cfg.log.dir = NULL;
16781678
}
16791679

0 commit comments

Comments
 (0)