-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build is failing when newlib is enabled #4638
Comments
The issue coming from the following TC_PRINT statement: TC_PRINT("diff = %" PRId32 " (t_last = %" PRIu32 If change the statement as below, no issue is seen: what is the significance of using "PRId32/PRIu32" ? |
The fix is to not mix zephyr/types.h and newlib's inttypes.h which this code appears to be doing |
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/inttypes.h.html We used to use these. |
Can i remove the "inttypes.h" and use regular format specifiers(%d/, %u) to fix the issue? |
PR merged: |
timer_monotonic (tests/kernel/timer/timer_monotonic/) is throwing following warnings when we compile the test with newlibc enabled (CONFIG_NEWLIB_LIBC=y).
And due this shippable is failing on newlibc dependent patches.
In file included from /home/rpallala/ssg-otc/zephyr/31st-Oct/zephyr/tests/kernel/timer/timer_monotonic/src/main.c:9:0:
/home/rpallala/ssg-otc/zephyr/31st-Oct/zephyr/tests/kernel/timer/timer_monotonic/src/main.c: In function âmainâ:
/home/rpallala/ssg-otc/zephyr/31st-Oct/zephyr/tests/kernel/timer/timer_monotonic/src/main.c:60:13: warning: format â%ldâ expects argument of type âlong intâ, but argument 2 has type âs32_t {aka int}â [-Wformat=]
TC_PRINT("diff = %" PRId32 " (t_last = %" PRIu32
^
/home/rpallala/ssg-otc/zephyr/31st-Oct/zephyr/tests/include/tc_util.h:22:37: note: in definition of macro âPRINT_DATAâ
#define PRINT_DATA(fmt, ...) printk(fmt, ##VA_ARGS)
^~~
/home/rpallala/ssg-otc/zephyr/31st-Oct/zephyr/tests/kernel/timer/timer_monotonic/src/main.c:60:4: note: in expansion of macro âTC_PRINTâ
TC_PRINT("diff = %" PRId32 " (t_last = %" PRIu32
^~~~~~~~
/home/rpallala/ssg-otc/zephyr/31st-Oct/zephyr/tests/kernel/timer/timer_monotonic/src/main.c:60:13: warning: format â%luâ expects argument of type âlong unsigned intâ, but argument 3 has type âu32_t {aka unsigned int}â [-Wformat=]
TC_PRINT("diff = %" PRId32 " (t_last = %" PRIu32
^
/home/rpallala/ssg-otc/zephyr/31st-Oct/zephyr/tests/include/tc_util.h:22:37: note: in definition of macro âPRINT_DATAâ
#define PRINT_DATA(fmt, ...) printk(fmt, ##VA_ARGS)
^~~
/home/rpallala/ssg-otc/zephyr/31st-Oct/zephyr/tests/kernel/timer/timer_monotonic/src/main.c:60:4: note: in expansion of macro âTC_PRINTâ
TC_PRINT("diff = %" PRId32 " (t_last = %" PRIu32
^~~~~~~~
/home/rpallala/ssg-otc/zephyr/31st-Oct/zephyr/tests/kernel/timer/timer_monotonic/src/main.c:60:13: warning: format â%luâ expects argument of type âlong unsigned intâ, but argument 4 has type âu32_t {aka unsigned int}â [-Wformat=]
TC_PRINT("diff = %" PRId32 " (t_last = %" PRIu32
^
/home/rpallala/ssg-otc/zephyr/31st-Oct/zephyr/tests/include/tc_util.h:22:37: note: in definition of macro âPRINT_DATAâ
#define PRINT_DATA(fmt, ...) printk(fmt, ##VA_ARGS)
^~~
/home/rpallala/ssg-otc/zephyr/31st-Oct/zephyr/tests/kernel/timer/timer_monotonic/src/main.c:60:4: note: in expansion of macro âTC_PRINTâ
TC_PRINT("diff = %" PRId32 " (t_last = %" PRIu32
^~~~~~~~
The text was updated successfully, but these errors were encountered: