Open
Conversation
added 2 commits
June 13, 2025 21:37
Fix the following build warnings:
$ aarch64-linux-gnu-gcc devmem2.c
devmem2.c: In function ‘main’:
devmem2.c:120:66: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]
120 | sprintf(fmt_str, "Read at address 0x%%08lX (%%p): 0x%%0%dlX\n", 2*data_size);
| ~^ ~~~~~~~~~~~
| | |
| int size_t {aka long unsigned int}
| %ld
devmem2.c:148:74: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]
148 | sprintf(fmt_str, "Write at address 0x%%08lX (%%p): 0x%%0%dlX, "
| ~^
| |
| int
| %ld
149 | "readback 0x%%0%dlX\n", 2*data_size, 2*data_size);
| ~~~~~~~~~~~
| |
| size_t {aka long unsigned int}
devmem2.c:148:34: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]
148 | sprintf(fmt_str, "Write at address 0x%%08lX (%%p): 0x%%0%dlX, "
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
149 | "readback 0x%%0%dlX\n", 2*data_size, 2*data_size);
| ~~~~~~~~~~~
| |
| size_t {aka long unsigned int}
devmem2.c:149:41: note: format string is defined here
149 | "readback 0x%%0%dlX\n", 2*data_size, 2*data_size);
| ~^
| |
| int
| %ld
Signed-off-by: George G. Davis <george.davis@teradyne.com>
Fix the following build warning:
$ aarch64-linux-gnu-gcc -Wunused-parameter devmem2.c
devmem2.c: In function ‘fixup_addr’:
devmem2.c:160:51: warning: unused parameter ‘size’ [-Wunused-parameter]
160 | static inline void *fixup_addr(void *addr, size_t size)
| ~~~~~~~^~~~
Signed-off-by: George G. Davis <george.davis@teradyne.com>
063552e to
fed8447
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix a couple of build warnings.