Skip to content
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

Time Base API test introduced new format warnings #505

Closed
jphickey opened this issue Jun 16, 2020 · 0 comments · Fixed by #507 or #521
Closed

Time Base API test introduced new format warnings #505

jphickey opened this issue Jun 16, 2020 · 0 comments · Fixed by #507 or #521
Assignees
Labels
Milestone

Comments

@jphickey
Copy link
Contributor

Describe the bug
New warnings noted when building for RTEMS:

/home/joe/code/cfecfs/github/osal/src/tests/time-base-api-test/time-base-api-test.c:110:5: error: format '%d' expects argument of type 'int', but argument 4 has type 'int32' [-Werror=format=]
     snprintf(overMaxTimeBase, 12, "TimeBase%d", TimeBaseNum);
     ^

To Reproduce
Build code using i686-rtems4.11 toolchain.

Expected behavior
Should build cleanly.

System observed on:
Cross compile for i686-rtems4.11 on Ubuntu 20.04 host.

Additional context
Needs cast whenever fixed-width types are used with printf.

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

jphickey added a commit to jphickey/osal that referenced this issue Jun 16, 2020
Add requisite cast to printf.
Also use sizeof() rather than hardcoded size of 12.
jphickey added a commit to jphickey/osal that referenced this issue Jun 16, 2020
Add requisite cast to printf.
Also use sizeof() rather than hardcoded size of 12.
@jphickey jphickey added the bug label Jun 16, 2020
@jphickey jphickey self-assigned this Jun 16, 2020
astrogeco added a commit that referenced this issue Jun 23, 2020
@astrogeco astrogeco added this to the v5.1.0 milestone Sep 28, 2020
jphickey pushed a commit to jphickey/osal that referenced this issue Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants