Warning fixes for gcc-7
warning: dynamic exception specifications are deprecated in C++11; use 'noexcept' instead [-Wdeprecated]
This commit is contained in:
parent
f5299fba82
commit
760c008311
24 changed files with 245 additions and 11 deletions
|
|
@ -6,6 +6,16 @@
|
|||
%apply std::string& INOUT { std::string &inout }
|
||||
#endif
|
||||
|
||||
%{
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
|
||||
#endif
|
||||
#if __GNUC__ >= 7
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated" // dynamic exception specifications are deprecated in C++11
|
||||
#endif
|
||||
%}
|
||||
|
||||
|
||||
%inline %{
|
||||
|
||||
|
|
@ -49,10 +59,6 @@ void test_reference_inout(std::string &inout) {
|
|||
inout += inout;
|
||||
}
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
|
||||
#endif
|
||||
|
||||
void test_throw() throw(std::string){
|
||||
static std::string x = "test_throw message";
|
||||
throw x;
|
||||
|
|
@ -154,6 +160,13 @@ public:
|
|||
const char *get_null(const char *a) {
|
||||
return a == 0 ? a : "non-null";
|
||||
}
|
||||
|
||||
|
||||
%}
|
||||
|
||||
%{
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(default: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
|
||||
#endif
|
||||
#if __GNUC__ >= 7
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
%}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue