Examples | examples/ticker: Fix format specifier warning in low_ticker2 (!23)

Somil Gupta (@somil) gitlab at rtems.org
Thu Mar 5 23:30:40 UTC 2026




Somil Gupta commented on a discussion: https://gitlab.rtems.org/rtems/rtos/rtems-examples/-/merge_requests/23#note_144452


Hi,

After fetching and building the latest main, the warning still appears in ticker/low_ticker2. It seems to come from the change in 3d119b14519c060b7817b76502a8a5c7efc820eb from https://gitlab.rtems.org/rtems/rtos/rtems-examples/-/merge_requests/21 where %zd is used for uptime.tv_sec.

Since %zd expects a size_t but tv_sec is time_t, this triggers the format warning. My MR changes the specifier to %ld and casts uptime.tv_sec to long so the types match and the warning is removed. Using long for more portability . @joel 

![image.png](/uploads/9a1bdc0b56416a744e951f18ad7b8d83/image.png){width=805 height=154}

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems-examples/-/merge_requests/23#note_144452
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260305/a4cef06d/attachment.htm>


More information about the bugs mailing list