This repository has been archived by the owner on Jun 27, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sol-log: Fix checking for NULL file and function macros
We can simplify the logic a little when printing the file and function in sol-log by imposing them to be an empty string (instead of NULL). This also solves this warning using gcc 5.3: CC build/stage/lib/common/sol-worker-thread.o CC build/stage/lib/common/sol-worker-thread-impl-posix.o ./src/lib/common/sol-log.c: In function 'sol_log_domain_init_level': ./src/lib/common/sol-log.c:63:34: warning: the address of '__PRETTY_FUNCTION__' will always evaluate as true' [-Waddress] SOL_LOG_FUNCTION ? : "", \ ^ ./src/lib/common/sol-log.c:271:5: note: in expansion of macro 'SOL_LOG_INIT_CHECK' SOL_LOG_INIT_CHECK("domain=%p", domain); ^ ./src/lib/common/sol-log.c: In function 'sol_log_vprint': ./src/lib/common/sol-log.c:63:34: warning: the address of '__PRETTY_FUNCTION__' will always evaluate as true' [-Waddress] SOL_LOG_FUNCTION ? : "", \ ^ ./src/lib/common/sol-log.c:301:5: note: in expansion of macro 'SOL_LOG_INIT_CHECK' SOL_LOG_INIT_CHECK("domain=%p, file=%s, function=%s, line=%d, fomart=%s", ^ ./src/lib/common/sol-log.c: In function 'sol_log_set_print_function': ./src/lib/common/sol-log.c:63:34: warning: the address of '__PRETTY_FUNCTION__' will always evaluate as true' [-Waddress] SOL_LOG_FUNCTION ? : "", \ ^ ./src/lib/common/sol-log.c:341:5: note: in expansion of macro 'SOL_LOG_INIT_CHECK' SOL_LOG_INIT_CHECK("cb=%p, data=%p", cb, data); ^ ./src/lib/common/sol-log.c: In function 'sol_log_level_to_str': ./src/lib/common/sol-log.c:63:34: warning: the address of '__PRETTY_FUNCTION__' will always evaluate as true' [-Waddress] SOL_LOG_FUNCTION ? : "", \ ^ ./src/lib/common/sol-log.c:369:5: note: in expansion of macro 'SOL_LOG_INIT_CHECK' SOL_LOG_INIT_CHECK("level=%hhu, buf=%p, buflen=%zd", level, buf, buflen); ^ ./src/lib/common/sol-log.c: In function 'sol_log_get_level_color': ./src/lib/common/sol-log.c:63:34: warning: the address of '__PRETTY_FUNCTION__' will always evaluate as true' [-Waddress] SOL_LOG_FUNCTION ? : "", \ ^ Signed-off-by: Vinicius Costa Gomes <[email protected]>
- Loading branch information