Mercurial > hg > octave-jordi
changeset 21007:9c41a7ee5e14
Mark certain gripe functions with GCC_ATTR_NORETURN.
* gripes.h, lo-array-gripes.h: Marke gripe functions which call error,
not warning, with GCC_ATTR_NORETURN.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 29 Dec 2015 09:39:41 -0800 |
parents | 0a09c3cae800 |
children | ea50940c362f |
files | libinterp/corefcn/gripes.h liboctave/util/lo-array-gripes.h |
diffstat | 2 files changed, 36 insertions(+), 32 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/gripes.h +++ b/libinterp/corefcn/gripes.h @@ -31,57 +31,58 @@ class octave_execution_exception; extern OCTINTERP_API void -gripe_not_supported (const char *); +gripe_not_supported (const char *) GCC_ATTR_NORETURN; extern OCTINTERP_API void -gripe_not_implemented (const char *); +gripe_not_implemented (const char *) GCC_ATTR_NORETURN; extern OCTINTERP_API void -gripe_string_invalid (void); +gripe_string_invalid (void) GCC_ATTR_NORETURN; extern OCTINTERP_API void -gripe_range_invalid (void); +gripe_range_invalid (void) GCC_ATTR_NORETURN; extern OCTINTERP_API void -gripe_nonconformant (void); +gripe_nonconformant (void) GCC_ATTR_NORETURN; extern OCTINTERP_API void gripe_nonconformant (octave_idx_type r1, octave_idx_type c1, - octave_idx_type r2, octave_idx_type c2); + octave_idx_type r2, octave_idx_type c2) GCC_ATTR_NORETURN; extern OCTINTERP_API void gripe_empty_arg (const char *name, bool is_error); extern OCTINTERP_API void -gripe_square_matrix_required (const char *name); +gripe_square_matrix_required (const char *name) GCC_ATTR_NORETURN; extern OCTINTERP_API void -gripe_user_supplied_eval (const char *name); +gripe_user_supplied_eval (const char *name) GCC_ATTR_NORETURN; extern OCTINTERP_API void gripe_user_supplied_eval (octave_execution_exception& e, - const char *name); + const char *name) GCC_ATTR_NORETURN; extern OCTINTERP_API void gripe_user_returned_invalid (const char *name); extern OCTINTERP_API void -gripe_invalid_conversion (const std::string& from, const std::string& to); +gripe_invalid_conversion (const std::string& from, + const std::string& to) GCC_ATTR_NORETURN; extern OCTINTERP_API void gripe_invalid_value_specified (const char *name); extern OCTINTERP_API void -gripe_2_or_3_dim_plot (void); +gripe_2_or_3_dim_plot (void) GCC_ATTR_NORETURN; extern OCTINTERP_API void -gripe_unrecognized_float_fmt (void); +gripe_unrecognized_float_fmt (void) GCC_ATTR_NORETURN; extern OCTINTERP_API void -gripe_unrecognized_data_fmt (const char *warn_for); +gripe_unrecognized_data_fmt (const char *warn_for) GCC_ATTR_NORETURN; extern OCTINTERP_API void -gripe_data_conversion (const char *from, const char *to); +gripe_data_conversion (const char *from, const char *to) GCC_ATTR_NORETURN; extern OCTINTERP_API void gripe_wrong_type_arg (const char *name, const char *s, @@ -141,10 +142,10 @@ const octave_value& tc, bool is_error = true); extern OCTINTERP_API void -gripe_wrong_type_arg_for_unary_op (const octave_value& op); +gripe_wrong_type_arg_for_unary_op (const octave_value& op) GCC_ATTR_NORETURN; extern OCTINTERP_API void -gripe_wrong_type_arg_for_binary_op (const octave_value& op); +gripe_wrong_type_arg_for_binary_op (const octave_value& op) GCC_ATTR_NORETURN; extern OCTINTERP_API void gripe_implicit_conversion (const char *id, const char *from, const char *to); @@ -160,20 +161,20 @@ gripe_logical_conversion (void); extern OCTINTERP_API void -gripe_invalid_inquiry_subscript (void); +gripe_invalid_inquiry_subscript (void) GCC_ATTR_NORETURN; extern OCTINTERP_API void -gripe_indexed_cs_list (void); +gripe_indexed_cs_list (void) GCC_ATTR_NORETURN; extern OCTINTERP_API void -gripe_nonbraced_cs_list_assignment (void); +gripe_nonbraced_cs_list_assignment (void) GCC_ATTR_NORETURN; extern OCTINTERP_API void gripe_warn_complex_cmp (void); extern OCTINTERP_API void gripe_disabled_feature (const std::string& func, const std::string& feature, - const std::string& pkg="Octave"); + const std::string& pkg="Octave") GCC_ATTR_NORETURN; extern OCTINTERP_API void gripe_data_file_in_path (const std::string& fcn, const std::string& file);
--- a/liboctave/util/lo-array-gripes.h +++ b/liboctave/util/lo-array-gripes.h @@ -110,55 +110,58 @@ extern OCTAVE_API const char *warning_id_singular_matrix; extern void OCTAVE_API -gripe_nan_to_logical_conversion (void); +gripe_nan_to_logical_conversion (void) GCC_ATTR_NORETURN; extern void OCTAVE_API -gripe_nan_to_character_conversion (void); +gripe_nan_to_character_conversion (void) GCC_ATTR_NORETURN; extern void OCTAVE_API gripe_nonconformant (const char *op, - octave_idx_type op1_len, octave_idx_type op2_len); + octave_idx_type op1_len, + octave_idx_type op2_len) GCC_ATTR_NORETURN; extern void OCTAVE_API gripe_nonconformant (const char *op, octave_idx_type op1_nr, octave_idx_type op1_nc, - octave_idx_type op2_nr, octave_idx_type op2_nc); + octave_idx_type op2_nr, octave_idx_type op2_nc) + GCC_ATTR_NORETURN; extern void OCTAVE_API gripe_nonconformant (const char *op, const dim_vector& op1_dims, - const dim_vector& op2_dims); + const dim_vector& op2_dims) GCC_ATTR_NORETURN; extern void OCTAVE_API gripe_index_out_of_range (int nd, int dim, octave_idx_type iext, octave_idx_type ext, - const dim_vector& d); + const dim_vector& d) GCC_ATTR_NORETURN; extern void OCTAVE_API gripe_index_out_of_range (int nd, int dim, - octave_idx_type iext, octave_idx_type ext); + octave_idx_type iext, octave_idx_type ext) + GCC_ATTR_NORETURN; extern void OCTAVE_API gripe_del_index_out_of_range (bool is1d, octave_idx_type iext, - octave_idx_type ext); + octave_idx_type ext) GCC_ATTR_NORETURN; extern void OCTAVE_API gripe_invalid_index (double, octave_idx_type nd = 0, octave_idx_type dim = 0, - const std::string& var = std::string ()); + const std::string& var = "") GCC_ATTR_NORETURN; extern void OCTAVE_API gripe_invalid_index (octave_idx_type n, octave_idx_type nd = 0, octave_idx_type dim = 0, - const std::string& var = std::string ()); + const std::string& var = "") GCC_ATTR_NORETURN; extern void OCTAVE_API gripe_invalid_index (const std::string& idx, octave_idx_type nd = 0, octave_idx_type dim = 0, - const std::string& var = std::string ()); + const std::string& var = "") GCC_ATTR_NORETURN; extern void OCTAVE_API -gripe_invalid_resize (void); +gripe_invalid_resize (void) GCC_ATTR_NORETURN; extern void OCTAVE_API gripe_singular_matrix (double rcond = 0.0);