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

api: fix -Wformat warnings #2025

Merged
merged 2 commits into from
Sep 2, 2024
Merged

api: fix -Wformat warnings #2025

merged 2 commits into from
Sep 2, 2024

Conversation

svenvh
Copy link
Member

@svenvh svenvh commented Jul 24, 2024

The main sources of warnings were:

  • Printing of a size_t which requires the %zu specifier.

  • Printing of cl_long/cl_ulong which is now done using the PRI*64 macros to ensure portability across 32 and 64-bit builds.

log_error("ERROR: Mem object " name \
" did not validate! (expected " type ", got " type \
" from %s:%d)\n", \
(cast)expected, (cast)val, __FILE__, __LINE__); \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only change here besides the formatting is the (cast) in front of expected.

EwanC
EwanC previously approved these changes Jul 24, 2024
Copy link
Contributor

@EwanC EwanC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpicking whether we should use PRIu64 rather than PRId64 for some cases, but LGTM in general.

test_conformance/api/test_queries.cpp Outdated Show resolved Hide resolved
test_conformance/api/test_api_min_max.cpp Outdated Show resolved Hide resolved
EwanC
EwanC previously approved these changes Jul 24, 2024
The main sources of warnings were:

 * Printing of a `size_t` which requires the `%zu` specifier.

 * Printing of `cl_long`/`cl_ulong` which is now done using the
   `PRI*64` macros to ensure portability across 32 and 64-bit builds.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
@svenvh
Copy link
Member Author

svenvh commented Aug 21, 2024

Rebased and fixed conflicts.

@svenvh svenvh merged commit 90f523e into KhronosGroup:main Sep 2, 2024
7 checks passed
@svenvh svenvh deleted the wformat-api branch September 2, 2024 10:02
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.

2 participants