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

Fix Clang warnings about printf format mismatches#1338

Open
thiagomacieira wants to merge 1 commit into
solettaproject:masterfrom
thiagomacieira:fixes/Fix-Clang-warnings-about-printf-format-mismatches
Open

Fix Clang warnings about printf format mismatches#1338
thiagomacieira wants to merge 1 commit into
solettaproject:masterfrom
thiagomacieira:fixes/Fix-Clang-warnings-about-printf-format-mismatches

Conversation

@thiagomacieira

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

Please explain the failure.

@barbieri

Copy link
Copy Markdown

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
Copy Markdown
Contributor Author

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

@thiagomacieira

Copy link
Copy Markdown
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.

2 participants