You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I´m running an unit test on a 64bit system. The module under test has some logging macros included.
The logging macro tries to cast pointers to u32_t values. This does not work on my system.
The cast should follow the compiler´s pointer size.
...sanity-out/unit_testing/tests/unit/drivers/pinctrl/test/main.c:712:3: note: in expansion of macro ‘LOG_ERR’
LOG_ERR("Invalid pin %d of %s on mux free by %s.",
^~~~~~~
...include/logging/log_core.h:147:46: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
log_3(_str, (u32_t)(_arg0), (u32_t)(_arg1), (u32_t)(_arg2), _src_level)
^
The text was updated successfully, but these errors were encountered:
arguments in log message are 32bit width so it will not work in 64bit system, they must be casted. You need to compile unit test in 32 bits. We might in future extend the logger to have argument size according to architecture but there are many other issues pending in the queue so it is rather a long term goal.
I´m running an unit test on a 64bit system. The module under test has some logging macros included.
The logging macro tries to cast pointers to u32_t values. This does not work on my system.
The cast should follow the compiler´s pointer size.
The text was updated successfully, but these errors were encountered: