Merged
Conversation
Grantim
reviewed
Jul 15, 2022
Comment on lines
+3
to
+23
| #if defined( __clang__ ) | ||
| #define SUPPRESS_DEPRECATION_WARNING( x ) \ | ||
| _Pragma( "clang diagnostic push" ) \ | ||
| _Pragma( "clang diagnostic ignored \"-Wdeprecated-declarations\"" ) \ | ||
| { x } \ | ||
| _Pragma( "clang diagnostic pop" ) | ||
| #elif defined( __GNUC__ ) | ||
| #define SUPPRESS_DEPRECATION_WARNING( x ) \ | ||
| _Pragma( "GCC diagnostic push" ) \ | ||
| _Pragma( "GCC diagnostic ignored \"-Wdeprecated-declarations\"" ) \ | ||
| { x } \ | ||
| _Pragma( "GCC diagnostic pop" ) | ||
| #elif defined( _MSC_VER ) | ||
| #define SUPPRESS_DEPRECATION_WARNING( x ) \ | ||
| _pragma( warning( push ) ) \ | ||
| _pragma( warning( disable: 4996 ) ) \ | ||
| { x } \ | ||
| _pragma( warning( pop ) ) | ||
| #else | ||
| #define SUPPRESS_DEPRECATION_WARNING( x ) { x } | ||
| #endif |
Contributor
There was a problem hiding this comment.
better add separate PUSH and POP macros, and let them have warning in argument
Contributor
There was a problem hiding this comment.
also lets use it in other places where we suppress warnings
Contributor
Author
There was a problem hiding this comment.
Clang/GCC and MSVC have different warning option formats, unified macros will have to have two arguments to support both of them.
Grantim
approved these changes
Jul 15, 2022
source/MRPch/MRSuppressWarning.h
Outdated
Comment on lines
+3
to
+22
| #define STR(...) #__VA_ARGS__ | ||
|
|
||
| #if defined( __clang__ ) | ||
| #define SUPPRESS_WARNING_PUSH( x, y ) \ | ||
| _Pragma( "clang diagnostic push" ) \ | ||
| _Pragma( STR(clang diagnostic ignored x) ) | ||
| #elif defined( __GNUC__ ) | ||
| #define SUPPRESS_WARNING_PUSH( x, y ) \ | ||
| _Pragma( "GCC diagnostic push ") \ | ||
| _Pragma( STR(GCC diagnostic ignored x) ) | ||
| #elif defined( _MSC_VER ) | ||
| #define SUPPRESS_WARNING_PUSH( x, y ) \ | ||
| __pragma( warning( push ) ) \ | ||
| __pragma( warning( disable: y ) ) | ||
| #else | ||
| #define SUPPRESS_WARNING_PUSH( x, y ) | ||
| #endif | ||
|
|
||
| #if defined( __clang__ ) | ||
| #define SUPPRESS_WARNING_POP \ |
Contributor
There was a problem hiding this comment.
Please add MR_ prefix to all new macros
Fedr
reviewed
Jul 15, 2022
source/MRPch/MRSuppressWarning.h
Outdated
| #define MR_STR(...) #__VA_ARGS__ | ||
|
|
||
| #if defined( __clang__ ) | ||
| #define MR_SUPPRESS_WARNING_PUSH( x, y ) \ |
Contributor
There was a problem hiding this comment.
I would add a comment that x is GCC/Clang warning id and y is MSVC warning number (or rename x and y)
Fedr
approved these changes
Jul 15, 2022
This file contains hidden or 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
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.
No description provided.