-
Notifications
You must be signed in to change notification settings - Fork 287
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
Suppress warnings in Function.cpp #550
Conversation
For backward compatibility, we have to call deprecated functions in Function.cpp, and compilers complain for these calls. This commit suppresses the warnings only for those calls. See also #544. Note that the suppression code couldn't be made as macros. It needs to use compiler dependent #pragma directives but directives is not allowed to be decleared in macros.
I wonder if we could make this more reusable, for example maybe we could have
And then we could wrap those around any function calls that we don't want to see deprecation warnings for. |
Right, I see. I guess the only way to overcome it would be to do some pre-preprocessing, but it's probably not worth it to take that route for this. |
Actually, that isn't quite true. According to StackOverflow you can use [Edit] This appears to be an addition in C++11. |
Updated the warning suppression with macros using
Hm, I need to check if MSVC supports this. |
As usual, MSVC is a pain in the ass. It uses #ifdef _MSC_VER
#define PRAGMA(x) __pragma(x)
#else
#define PRAGMA(x) _Pragma(#x)
#endif |
Right, I had to use The wrapper looks good but I would prefer to use it when we found more use cases. |
This looks really good now 👍 |
Thanks! Merging now. |
Suppress warnings in Function.cpp
For backward compatibility, we have to call deprecated functions in Function.cpp, but the compilers complain for these calls. This pull request suppresses the warnings only for those calls. See also #544.
Note that the suppression code couldn't be made as macros. It needs to use compiler dependent #pragma directives but directives is not allowed to be declared in macros.