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

Fix warnings under MSVC #679

Merged
merged 2 commits into from Mar 14, 2018
Merged

Fix warnings under MSVC #679

merged 2 commits into from Mar 14, 2018

Conversation

foonathan
Copy link
Contributor

See #678.

@foonathan foonathan merged commit 4006678 into master Mar 14, 2018
@foonathan foonathan deleted the warning-fix branch March 14, 2018 19:17
Copy link
Contributor

@vitaut vitaut left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the fixes, just one small comment.

@@ -1452,7 +1452,7 @@ class arg_formatter_base {

void operator()(const char_type *value) {
internal::handle_cstring_type_spec(
specs_.type_, cstring_spec_handler(*this, value));
static_cast<char>(specs_.type_), cstring_spec_handler(*this, value));
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be better to make character type a template parameter of handle_cstring_type_spec instead, because otherwise an invalid type specifier can be transformed into a valid one by a narrowing cast which is undesirable.

Same in similar places below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, you just did that, I was grepping through the code and couldn't find those casts anymore.. :D

Copy link
Contributor

Choose a reason for hiding this comment

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

No worries =)

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.

None yet

2 participants