diff --git a/cmake/Modules/ValkeySetup.cmake b/cmake/Modules/ValkeySetup.cmake index 8a4d4da1c9..77360844fc 100644 --- a/cmake/Modules/ValkeySetup.cmake +++ b/cmake/Modules/ValkeySetup.cmake @@ -93,6 +93,9 @@ macro (valkey_build_and_install_bin target sources ld_flags libs link_name) target_link_libraries(${target} execinfo) endif () + # Enable all warnings + fail on warning + target_compile_options(${target} PRIVATE -Werror -Wall) + # Install cli tool and create a redis symbolic link valkey_install_bin(${target}) valkey_create_symlink(${target} ${link_name}) diff --git a/src/valkey-cli.c b/src/valkey-cli.c index 4416e09431..0a4f1affa2 100644 --- a/src/valkey-cli.c +++ b/src/valkey-cli.c @@ -2040,6 +2040,8 @@ static sds jsonStringOutput(sds out, const char *p, int len, int mode) { } else { assert(0); } + /* Silence compiler warning */ + return NULL; } static sds cliFormatReplyJson(sds out, redisReply *r, int mode) {