From 40686303efab82571ea37d0bf901360ed2219795 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 17 Apr 2021 20:09:39 +0200 Subject: main: explicitly cast log_colorize to enum fcft_log_colorize Fixes error in Clang builds: ../../foot/main.c:376:19: error: implicit conversion from enumeration type 'enum log_colorize' to different enumeration type 'enum fcft_log_colorize' [-Werror,-Wenum-conversion] fcft_log_init(log_colorize, as_server && log_syslog, log_level + 1); ~~~~~~~~~~~~~ ^~~~~~~~~~~~ --- main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 3e59ea96..19c1904b 100644 --- a/main.c +++ b/main.c @@ -372,8 +372,10 @@ main(int argc, char *const *argv) as_server ? LOG_FACILITY_DAEMON : LOG_FACILITY_USER, log_level); _Static_assert(LOG_CLASS_ERROR + 1 == FCFT_LOG_CLASS_ERROR, - "fixme: fcft log level enum offset"); - fcft_log_init(log_colorize, as_server && log_syslog, log_level + 1); + "fcft log level enum offset"); + _Static_assert((int)LOG_COLORIZE_ALWAYS == (int)FCFT_LOG_COLORIZE_ALWAYS, + "fcft colorize enum mismatch"); + fcft_log_init((enum fcft_log_colorize)log_colorize, as_server && log_syslog, log_level + 1); argc -= optind; argv += optind; -- cgit v1.3