This repository was archived by the owner on Jun 27, 2019. It is now read-only.
Commit 97091af
committed
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 <vinicius.gomes@intel.com>1 parent 20e3abd commit 97091af
2 files changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
472 | 472 | | |
473 | 473 | | |
474 | 474 | | |
475 | | - | |
| 475 | + | |
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
| |||
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
492 | | - | |
| 492 | + | |
493 | 493 | | |
494 | 494 | | |
495 | 495 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
0 commit comments