-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 more Visual Studio 2019 pedantic warnings #1371
Merged
Merged
Conversation
This file contains 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
…n operation format.h(2808,1): warning C4127: conditional expression is constant
vitaut
requested changes
Oct 21, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR.
If "constexpr if" is available and used, MSVC won't issue a "conditional
expression is constant" warning. It looks like for this particular warning,
it could be used (if C++17 is enabled).
…On Mon, Oct 21, 2019, 07:08 Ivan Shynkarenka ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In include/fmt/format.h
<#1371 (comment)>:
> @@ -71,6 +71,11 @@
# define FMT_HAS_BUILTIN(x) 0
#endif
+#ifdef _MSC_VER
+# pragma warning(push)
+# pragma warning(disable : 4127) // conditional expression is constant
I'll look if this could be made more specific
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1371?email_source=notifications&email_token=AAIID3ZAPQAVXMMHZMCUE7LQPWZWHA5CNFSM4JCZ5XI2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCIT2SIY#discussion_r337038444>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIID3ZROJOD77RIS6W463TQPWZWHANCNFSM4JCZ5XIQ>
.
|
... which you just now did! sorry for the noise.
On Mon, Oct 21, 2019, 07:13 Michael Winterberg <[email protected]>
wrote:
… If "constexpr if" is available and used, MSVC won't issue a "conditional
expression is constant" warning. It looks like for this particular warning,
it could be used (if C++17 is enabled).
On Mon, Oct 21, 2019, 07:08 Ivan Shynkarenka ***@***.***>
wrote:
> ***@***.**** commented on this pull request.
> ------------------------------
>
> In include/fmt/format.h
> <#1371 (comment)>:
>
> > @@ -71,6 +71,11 @@
> # define FMT_HAS_BUILTIN(x) 0
> #endif
>
> +#ifdef _MSC_VER
> +# pragma warning(push)
> +# pragma warning(disable : 4127) // conditional expression is constant
>
> I'll look if this could be made more specific
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#1371?email_source=notifications&email_token=AAIID3ZAPQAVXMMHZMCUE7LQPWZWHA5CNFSM4JCZ5XI2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCIT2SIY#discussion_r337038444>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAIID3ZROJOD77RIS6W463TQPWZWHANCNFSM4JCZ5XIQ>
> .
>
|
vitaut
reviewed
Oct 21, 2019
Do we need something more to fix in the PR to merge it? |
No, all looks good. Thanks for the fix! |
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.
…n operation
format.h(2808,1): warning C4127: conditional expression is constant
I agree that my contributions are licensed under the {fmt} license, and agree to future changes to the licensing.