Mercurial > octave
changeset 21135:95da3bc8a281
supress deprecated function warnings in Octave code
* lo-array-gripes.cc, gripes.cc: Use GCC pragmas to suppress
deprecated function warnings.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 22 Jan 2016 13:45:21 -0500 |
parents | 2e5c1f766ac9 |
children | 7cac4e7458f2 |
files | libinterp/corefcn/gripes.cc liboctave/util/lo-array-gripes.cc |
diffstat | 2 files changed, 137 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/gripes.cc Fri Jan 22 12:15:12 2016 -0500 +++ b/libinterp/corefcn/gripes.cc Fri Jan 22 13:45:21 2016 -0500 @@ -199,7 +199,16 @@ { octave_execution_exception e; +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + gripe_user_supplied_eval (e, name); + +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic pop +#endif } void @@ -221,7 +230,16 @@ { octave_execution_exception e; +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + gripe_wrong_type_arg (e, name, s, is_error); + +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic pop +#endif } void @@ -239,14 +257,32 @@ { octave_execution_exception e; +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + gripe_wrong_type_arg (e, name, s.c_str (), is_error); + +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic pop +#endif } void gripe_wrong_type_arg (octave_execution_exception& e, const char *name, const std::string& s, bool is_error) { +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + gripe_wrong_type_arg (e, name, s.c_str (), is_error); + +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic pop +#endif } void @@ -255,7 +291,16 @@ { octave_execution_exception e; +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + gripe_wrong_type_arg (e, name, tc, is_error); + +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic pop +#endif } void @@ -265,7 +310,16 @@ { std::string type = tc.type_name (); +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + gripe_wrong_type_arg (e, name, type, is_error); + +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic pop +#endif } void @@ -274,7 +328,16 @@ { octave_execution_exception e; +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + gripe_wrong_type_arg (e, name, tc, is_error); + +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic pop +#endif } void @@ -282,7 +345,16 @@ const std::string& name, const octave_value& tc, bool is_error) { +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + gripe_wrong_type_arg (e, name.c_str (), tc, is_error); + +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic pop +#endif } void @@ -290,7 +362,16 @@ { octave_execution_exception e; +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + gripe_wrong_type_arg (e, s, is_error); + +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic pop +#endif } void @@ -308,14 +389,32 @@ { octave_execution_exception e; +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + gripe_wrong_type_arg (e, s, is_error); + +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic pop +#endif } void gripe_wrong_type_arg (octave_execution_exception& e, const std::string& s, bool is_error) { +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + gripe_wrong_type_arg (e, s.c_str (), is_error); + +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic pop +#endif } void @@ -323,7 +422,16 @@ { octave_execution_exception e; +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + gripe_wrong_type_arg (e, tc, is_error); + +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic pop +#endif } void @@ -332,7 +440,16 @@ { std::string type = tc.type_name (); +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + gripe_wrong_type_arg (e, type, is_error); + +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic pop +#endif } void
--- a/liboctave/util/lo-array-gripes.cc Fri Jan 22 12:15:12 2016 -0500 +++ b/liboctave/util/lo-array-gripes.cc Fri Jan 22 13:45:21 2016 -0500 @@ -147,7 +147,17 @@ { std::ostringstream buf; buf << n + 1; + +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + gripe_invalid_index (buf.str (), nd, dim, var); + +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic pop +#endif } void @@ -156,7 +166,17 @@ { std::ostringstream buf; buf << n + 1; + +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + gripe_invalid_index (buf.str (), nd, dim, var); + +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic pop +#endif }