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

rpsock_client.c: fix printf format warning #2258

Merged
merged 1 commit into from
Jan 12, 2024

Conversation

wyr8899
Copy link

@wyr8899 wyr8899 commented Jan 12, 2024

Summary

rpsock_client.c: fix printf format warning as flows
rpsock_client.c:203:30: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘long unsigned int’ [-Wformat=]
203 | printf("client check fail total %d,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
204 | i %d, %08" PRIx32 ", %08x\n",
| ~~~~~~~~~~
205 | ALIGN_UP(total), i, intp[i],
206 | (ALIGN_UP(total) / sizeof(uint32_t) + i));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| long unsigned int

Impact

Reduce warnings and reduce the possibility of inaccurate data on other platforms

Testing

Tested in sim vela and 86panel

rpsock_client.c:203:30: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘long unsigned int’ [-Wformat=]
  203 |                       printf("client check fail total %d, \
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  204 |                               i %d, %08" PRIx32 ", %08x\n",
      |                               ~~~~~~~~~~
  205 |                               ALIGN_UP(total), i, intp[i],
  206 |                               (ALIGN_UP(total) / sizeof(uint32_t) + i));
      |                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                                   |
      |                                                                   long unsigned int

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
@xiaoxiang781216 xiaoxiang781216 merged commit 5f1de35 into apache:master Jan 12, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants