-
Notifications
You must be signed in to change notification settings - Fork 216
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
Fix #273: Correct format code in debug message #276
Conversation
Cast the address value so it may be printed as an integer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to report as 64 bit, since address could be up to this size?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is OK for now. RTEMS supports 3 64 bit architectures (x86_64, Sparc64, and RISCV) and we don't currently have them on our radar. The first RTEMS 64 bit port will probably need to go through and address any items like this.
As it is |
Isn't the format of 0x%08lX only up to 8 digits? |
The printf field width (8) is a minimum width. Printf formatters will go beyond the specified width to print the value; they don't truncate, they just expand. So on a 64-bit platform it will just print more digits as needed, it'll work fine. |
CCB 20191030 - Code reviewed and approved |
Describe the contribution
Fixes issue #273
Just adds a typecast to avoid the warning
Testing performed
Build code on i686-rtems4.11 platform, with -Wall -Werror and OS_DEBUG_PRINTF option enabled.
Expected behavior changes
Observe no more warning about the format mismatch.
System(s) tested on:
Ubuntu 18.04.2 LTS 64 bit (build host) using i686-rtems4.11 cross toolchain
Contributor Info
Joseph Hickey, Vantage Systems, Inc.