Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Fix Clang warnings about printf format mismatches #1338

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix Clang warnings about printf format mismatches #1338

wants to merge 1 commit into from

Conversation

thiagomacieira
Copy link
Contributor

All of the API version numbers are declared as plain integer literals,
so using %hu is wrong. They are int, not unsigned short.

The booleans are not to be printed as %hhu.

Signed-off-by: Thiago Macieira thiago.macieira@intel.com

All of the API version numbers are declared as plain integer literals,
so using %hu is wrong. They are int, not unsigned short.

The booleans are not to be printed as %hhu.

Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
@thiagomacieira
Copy link
Contributor Author

Please explain the failure.

@barbieri
Copy link

why boolean not to be print with %hhu?

If we can't find a way to print boolean, then at least provide SOL_BOOL_STR(x) ((x) ? "true" : "false"), but I'd like to keep them as numbers to avoid cluttering file size.

@thiagomacieira
Copy link
Contributor Author

Because bool is not uint8_t, therefore %hhu is incorrect. I can introduce a cast, instead.

@thiagomacieira
Copy link
Contributor Author

I'm postponing this until I convert more of the Linux→Unix checks. There may be more of these.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants