Mercurial > octave
changeset 21040:3e7cfee5f786
maint: Rename attributes GCC_ATTR_XXX to OCTAVE_XXX.
* oct-conf-post.in.h: Rename macros GCC_ATTR_XXX to OCTAVE_XXX. Add comments
describing purpose of macros. Add FIXME note about switching macros to C++
standard convention. Add FIXME note about using visibility attributes.
* error.cc, error.h, gripes.h, jit-typeinfo.cc, load-save.cc, oct-stream.cc,
pt-jit.cc, symtab.h, variables.h, ov-base-sparse.h, ov-base.cc, ov-base.h,
ov-class.cc, ov-classdef.cc, ov-classdef.h, ov.cc, ov.h, octave.cc, pt-mat.cc,
Array.h, DiagArray2.h, PermMatrix.h, Range.h, Sparse.h, dSparse.h, f77-fcn.h,
lo-error.c, lo-error.h, quit.h, SparseCmplxQR.cc, lo-array-gripes.h,
unwind-prot.h: Rename attributes GCC_ATTR_XXX to OCTAVE_XXX.
line wrap: on
line diff
--- a/libinterp/corefcn/error.cc Tue Jan 05 13:04:02 2016 -0800 +++ b/libinterp/corefcn/error.cc Tue Jan 05 14:16:58 2016 -0800 @@ -393,7 +393,7 @@ va_end (args); } -GCC_ATTR_NORETURN static +OCTAVE_NORETURN static void usage_1 (octave_execution_exception& e, const char *id, const char *fmt, va_list args) @@ -405,7 +405,7 @@ throw e; } -GCC_ATTR_NORETURN static +OCTAVE_NORETURN static void usage_1 (const char *id, const char *fmt, va_list args) { @@ -444,7 +444,7 @@ va_end (args); } -GCC_ATTR_NORETURN static +OCTAVE_NORETURN static void error_1 (octave_execution_exception& e, std::ostream& os, const char *name, const char *id, const char *fmt, @@ -492,7 +492,7 @@ throw e; } -GCC_ATTR_NORETURN static +OCTAVE_NORETURN static void error_1 (std::ostream& os, const char *name, const char *id, const char *fmt, va_list args, bool with_cfn = false)
--- a/libinterp/corefcn/error.h Tue Jan 05 13:04:02 2016 -0800 +++ b/libinterp/corefcn/error.h Tue Jan 05 14:16:58 2016 -0800 @@ -43,34 +43,34 @@ extern OCTINTERP_API void message (const char *name, const char *fmt, ...); -GCC_ATTR_DEPRECATED GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_DEPRECATED OCTAVE_NORETURN OCTINTERP_API extern void vusage (const char *fmt, va_list args); -GCC_ATTR_DEPRECATED GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_DEPRECATED OCTAVE_NORETURN OCTINTERP_API extern void usage (const char *fmt, ...); extern OCTINTERP_API void vwarning (const char *fmt, va_list args); extern OCTINTERP_API void warning (const char *fmt, ...); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void verror (const char *fmt, va_list args); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void error (const char *fmt, ...); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void verror (octave_execution_exception&, const char *fmt, va_list args); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void error (octave_execution_exception&, const char *fmt, ...); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void verror_with_cfn (const char *fmt, va_list args); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void error_with_cfn (const char *fmt, ...); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void vparse_error (const char *fmt, va_list args); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void parse_error (const char *fmt, ...); extern OCTINTERP_API void @@ -80,10 +80,10 @@ extern OCTINTERP_API void message_with_id (const char *id, const char *name, const char *fmt, ...); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void vusage_with_id (const char *id, const char *fmt, va_list args); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void usage_with_id (const char *id, const char *fmt, ...); extern OCTINTERP_API void @@ -92,25 +92,25 @@ extern OCTINTERP_API void warning_with_id (const char *id, const char *fmt, ...); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void verror_with_id (const char *id, const char *fmt, va_list args); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void error_with_id (const char *id, const char *fmt, ...); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void verror_with_id_cfn (const char *id, const char *fmt, va_list args); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void error_with_id_cfn (const char *id, const char *fmt, ...); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void vparse_error_with_id (const char *id, const char *fmt, va_list args); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void parse_error_with_id (const char *id, const char *fmt, ...); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void panic (const char *fmt, ...); // Helper function for print_usage defined in defun.cc.
--- a/libinterp/corefcn/gripes.h Tue Jan 05 13:04:02 2016 -0800 +++ b/libinterp/corefcn/gripes.h Tue Jan 05 14:16:58 2016 -0800 @@ -34,16 +34,16 @@ // Alphabetized list of gripes. //////////////////////////////////////////////////////////////////////////////// -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void gripe_2_or_3_dim_plot (void); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void gripe_data_conversion (const char *from, const char *to); extern OCTINTERP_API void gripe_data_file_in_path (const std::string& fcn, const std::string& file); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void gripe_disabled_feature (const std::string& func, const std::string& feature, const std::string& pkg="Octave"); @@ -61,13 +61,13 @@ gripe_implicit_conversion (const std::string& id, const std::string& from, const std::string& to); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void gripe_indexed_cs_list (void); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void gripe_invalid_conversion (const std::string& from, const std::string& to); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void gripe_invalid_inquiry_subscript (void); extern OCTINTERP_API void @@ -76,44 +76,44 @@ extern OCTINTERP_API void gripe_logical_conversion (void); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void gripe_nonbraced_cs_list_assignment (void); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void gripe_nonconformant (void); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void gripe_nonconformant (octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void gripe_not_implemented (const char *); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void gripe_not_supported (const char *); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void gripe_range_invalid (void); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void gripe_square_matrix_required (const char *name); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void gripe_string_invalid (void); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void gripe_unrecognized_data_fmt (const char *warn_for); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void gripe_unrecognized_float_fmt (void); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void gripe_user_returned_invalid (const char *name); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void gripe_user_supplied_eval (const char *name); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void gripe_user_supplied_eval (octave_execution_exception& e, const char *name); extern OCTINTERP_API void @@ -182,10 +182,10 @@ const octave_value& tc, bool is_error = true); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void gripe_wrong_type_arg_for_binary_op (const octave_value& op); -GCC_ATTR_NORETURN OCTINTERP_API extern +OCTAVE_NORETURN OCTINTERP_API extern void gripe_wrong_type_arg_for_unary_op (const octave_value& op); #endif
--- a/libinterp/corefcn/jit-typeinfo.cc Tue Jan 05 13:04:02 2016 -0800 +++ b/libinterp/corefcn/jit-typeinfo.cc Tue Jan 05 14:16:58 2016 -0800 @@ -439,7 +439,7 @@ std::cout << *m << std::endl; } -GCC_ATTR_NORETURN static +OCTAVE_NORETURN static void gripe_bad_result (void) {
--- a/libinterp/corefcn/load-save.cc Tue Jan 05 13:04:02 2016 -0800 +++ b/libinterp/corefcn/load-save.cc Tue Jan 05 14:16:58 2016 -0800 @@ -126,7 +126,7 @@ // no newline characters. static std::string Vsave_header_format_string = default_save_header_format (); -GCC_ATTR_NORETURN static +OCTAVE_NORETURN static void gripe_file_open (const std::string& fcn, const std::string& file) {
--- a/libinterp/corefcn/oct-stream.cc Tue Jan 05 13:04:02 2016 -0800 +++ b/libinterp/corefcn/oct-stream.cc Tue Jan 05 14:16:58 2016 -0800 @@ -4155,7 +4155,7 @@ return stream_number; } -GCC_ATTR_NORETURN static +OCTAVE_NORETURN static void gripe_invalid_file_id (int fid, const std::string& who) {
--- a/libinterp/corefcn/pt-jit.cc Tue Jan 05 13:04:02 2016 -0800 +++ b/libinterp/corefcn/pt-jit.cc Tue Jan 05 14:16:58 2016 -0800 @@ -2511,7 +2511,7 @@ #if defined (HAVE_LLVM) #define UNUSED_WITHOUT_LLVM(x) x #else -#define UNUSED_WITHOUT_LLVM(x) x GCC_ATTR_UNUSED +#define UNUSED_WITHOUT_LLVM(x) x OCTAVE_UNUSED #endif DEFUN (jit_failcnt, UNUSED_WITHOUT_LLVM (args),
--- a/libinterp/corefcn/symtab.h Tue Jan 05 13:04:02 2016 -0800 +++ b/libinterp/corefcn/symtab.h Tue Jan 05 14:16:58 2016 -0800 @@ -1340,7 +1340,7 @@ } // Use assign (name, value, scope, context, force_add) instead. - GCC_ATTR_DEPRECATED static + OCTAVE_DEPRECATED static octave_value& varref (const std::string& name, scope_id scope = xcurrent_scope, context_id context = xdefault_context, bool force_add = false) @@ -1364,7 +1364,7 @@ } // Use force_assign (name, value, scope, context) instead. - GCC_ATTR_DEPRECATED static + OCTAVE_DEPRECATED static octave_value& force_varref (const std::string& name, scope_id scope = xcurrent_scope, context_id context = xdefault_context) @@ -1399,7 +1399,7 @@ } // Use global_assign (name, value) instead. - GCC_ATTR_DEPRECATED static + OCTAVE_DEPRECATED static octave_value& global_varref (const std::string& name) @@ -1425,7 +1425,7 @@ } // Use top_level_assign (name, value) instead. - GCC_ATTR_DEPRECATED static + OCTAVE_DEPRECATED static octave_value& top_level_varref (const std::string& name) { @@ -1453,7 +1453,7 @@ } // Use persistent_assign (name, value) instead. - GCC_ATTR_DEPRECATED static + OCTAVE_DEPRECATED static octave_value& persistent_varref (const std::string& name) {
--- a/libinterp/corefcn/variables.h Tue Jan 05 13:04:02 2016 -0800 +++ b/libinterp/corefcn/variables.h Tue Jan 05 14:16:58 2016 -0800 @@ -137,7 +137,7 @@ extern OCTINTERP_API void bind_ans (const octave_value& val, bool print); -GCC_ATTR_DEPRECATED OCTINTERP_API extern +OCTAVE_DEPRECATED OCTINTERP_API extern void bind_internal_variable (const std::string& fname, const octave_value& val); extern OCTINTERP_API void mlock (void);
--- a/libinterp/octave-value/ov-base-sparse.h Tue Jan 05 13:04:02 2016 -0800 +++ b/libinterp/octave-value/ov-base-sparse.h Tue Jan 05 14:16:58 2016 -0800 @@ -143,7 +143,7 @@ bool is_true (void) const; - GCC_ATTR_DEPRECATED octave_idx_type capacity (void) const { return nzmax (); } + OCTAVE_DEPRECATED octave_idx_type capacity (void) const { return nzmax (); } bool print_as_scalar (void) const;
--- a/libinterp/octave-value/ov-base.cc Tue Jan 05 13:04:02 2016 -0800 +++ b/libinterp/octave-value/ov-base.cc Tue Jan 05 14:16:58 2016 -0800 @@ -1297,7 +1297,7 @@ << " dims: " << dv.str (); } -GCC_ATTR_NORETURN static +OCTAVE_NORETURN static void gripe_indexed_assignment (const std::string& tn1, const std::string& tn2) { @@ -1305,7 +1305,7 @@ tn2.c_str (), tn1.c_str ()); } -GCC_ATTR_NORETURN static +OCTAVE_NORETURN static void gripe_assign_conversion_failed (const std::string& tn1, const std::string& tn2) { @@ -1313,7 +1313,7 @@ tn2.c_str (), tn1.c_str ()); } -GCC_ATTR_NORETURN static +OCTAVE_NORETURN static void gripe_no_conversion (const std::string& on, const std::string& tn1, const std::string& tn2)
--- a/libinterp/octave-value/ov-base.h Tue Jan 05 13:04:02 2016 -0800 +++ b/libinterp/octave-value/ov-base.h Tue Jan 05 14:16:58 2016 -0800 @@ -310,7 +310,7 @@ virtual octave_idx_type numel (void) const { return dims ().numel (); } - GCC_ATTR_DEPRECATED virtual octave_idx_type capacity (void) const + OCTAVE_DEPRECATED virtual octave_idx_type capacity (void) const { return numel (); } virtual size_t byte_size (void) const { return 0; }
--- a/libinterp/octave-value/ov-class.cc Tue Jan 05 13:04:02 2016 -0800 +++ b/libinterp/octave-value/ov-class.cc Tue Jan 05 14:16:58 2016 -0800 @@ -238,21 +238,21 @@ return retval; } -GCC_ATTR_NORETURN static +OCTAVE_NORETURN static void gripe_invalid_index1 (void) { error ("invalid index for class"); } -GCC_ATTR_NORETURN static +OCTAVE_NORETURN static void gripe_invalid_index_for_assignment (void) { error ("invalid index for class assignment"); } -GCC_ATTR_NORETURN static +OCTAVE_NORETURN static void gripe_invalid_index_type (const std::string& nm, char t) {
--- a/libinterp/octave-value/ov-classdef.cc Tue Jan 05 13:04:02 2016 -0800 +++ b/libinterp/octave-value/ov-classdef.cc Tue Jan 05 14:16:58 2016 -0800 @@ -48,7 +48,7 @@ // Define to 1 to enable debugging statements. #define DEBUG_TRACE 0 -GCC_ATTR_NORETURN static +OCTAVE_NORETURN static void gripe_method_access (const std::string& from, const cdef_method& meth) { @@ -64,7 +64,7 @@ from.c_str (), meth.get_name ().c_str (), acc_s.c_str ()); } -GCC_ATTR_NORETURN static +OCTAVE_NORETURN static void gripe_property_access (const std::string& from, const cdef_property& prop, bool is_set = false)
--- a/libinterp/octave-value/ov-classdef.h Tue Jan 05 13:04:02 2016 -0800 +++ b/libinterp/octave-value/ov-classdef.h Tue Jan 05 14:16:58 2016 -0800 @@ -175,7 +175,7 @@ // No assignment cdef_object_rep& operator = (const cdef_object_rep& ); - GCC_ATTR_NORETURN void gripe_invalid_object (const char *who) const + OCTAVE_NORETURN void gripe_invalid_object (const char *who) const { error ("%s: invalid object", who); } };
--- a/libinterp/octave-value/ov.cc Tue Jan 05 13:04:02 2016 -0800 +++ b/libinterp/octave-value/ov.cc Tue Jan 05 14:16:58 2016 -0800 @@ -2315,7 +2315,7 @@ return retval; } -GCC_ATTR_NORETURN static +OCTAVE_NORETURN static void gripe_cat_op (const std::string& tn1, const std::string& tn2) { @@ -2323,7 +2323,7 @@ tn1.c_str (), tn2.c_str ()); } -GCC_ATTR_NORETURN static +OCTAVE_NORETURN static void gripe_cat_op_conv (void) {
--- a/libinterp/octave-value/ov.h Tue Jan 05 13:04:02 2016 -0800 +++ b/libinterp/octave-value/ov.h Tue Jan 05 14:16:58 2016 -0800 @@ -242,11 +242,11 @@ octave_value (const charMatrix& chm, char type = '\''); octave_value (const charNDArray& chnda, char type = '\''); octave_value (const Array<char>& chnda, char type = '\''); - GCC_ATTR_DEPRECATED octave_value (const charMatrix& chm, bool is_string, + OCTAVE_DEPRECATED octave_value (const charMatrix& chm, bool is_string, char type = '\''); - GCC_ATTR_DEPRECATED octave_value (const charNDArray& chnda, bool is_string, + OCTAVE_DEPRECATED octave_value (const charNDArray& chnda, bool is_string, char type = '\''); - GCC_ATTR_DEPRECATED octave_value (const Array<char>& chnda, bool is_string, + OCTAVE_DEPRECATED octave_value (const Array<char>& chnda, bool is_string, char type = '\''); octave_value (const SparseMatrix& m, const MatrixType& t = MatrixType ()); octave_value (const Sparse<double>& m, const MatrixType& t = MatrixType ()); @@ -296,7 +296,7 @@ octave_value (octave_value::magic_colon); octave_value (octave_base_value *new_rep, bool borrow = false); - GCC_ATTR_DEPRECATED octave_value (octave_base_value *new_rep, int xcount); + OCTAVE_DEPRECATED octave_value (octave_base_value *new_rep, int xcount); // Copy constructor. @@ -481,7 +481,7 @@ octave_idx_type numel (void) const { return rep->numel (); } - GCC_ATTR_DEPRECATED octave_idx_type capacity (void) const + OCTAVE_DEPRECATED octave_idx_type capacity (void) const { return rep->numel (); } size_t byte_size (void) const @@ -892,7 +892,7 @@ string_vector string_vector_value (bool pad = false) const { return rep->string_vector_value (pad); } - GCC_ATTR_DEPRECATED string_vector all_strings (bool pad = false) const + OCTAVE_DEPRECATED string_vector all_strings (bool pad = false) const { return string_vector_value (pad); } Cell cell_value (void) const;
--- a/libinterp/octave.cc Tue Jan 05 13:04:02 2016 -0800 +++ b/libinterp/octave.cc Tue Jan 05 14:16:58 2016 -0800 @@ -456,7 +456,7 @@ safe_source_file (fname, context, verbose, require_file, "octave"); } -GCC_ATTR_NORETURN static void +OCTAVE_NORETURN static void lo_error_handler (const char *fmt, ...) { va_list args; @@ -467,7 +467,7 @@ octave_throw_execution_exception (); } -GCC_ATTR_NORETURN static void +OCTAVE_NORETURN static void lo_error_with_id_handler (const char *id, const char *fmt, ...) { va_list args;
--- a/libinterp/parse-tree/pt-mat.cc Tue Jan 05 13:04:02 2016 -0800 +++ b/libinterp/parse-tree/pt-mat.cc Tue Jan 05 14:16:58 2016 -0800 @@ -273,7 +273,7 @@ return retval; } -GCC_ATTR_NORETURN static +OCTAVE_NORETURN static void eval_error (const char *msg, const dim_vector& x, const dim_vector& y) {
--- a/liboctave/array/Array.h Tue Jan 05 13:04:02 2016 -0800 +++ b/liboctave/array/Array.h Tue Jan 05 14:16:58 2016 -0800 @@ -254,7 +254,7 @@ //! Number of elements in the array. //! Synonymous with numel(). //! @note This method is deprecated in favour of numel(). - GCC_ATTR_DEPRECATED octave_idx_type capacity (void) const { return numel (); } + OCTAVE_DEPRECATED octave_idx_type capacity (void) const { return numel (); } //! Number of elements in the array. /*! Synonymous with numel(). @@ -266,12 +266,12 @@ length of the greatest dimension. This method returns the total number of elements. */ - GCC_ATTR_DEPRECATED octave_idx_type length (void) const { return numel (); } + OCTAVE_DEPRECATED octave_idx_type length (void) const { return numel (); } //! Number of elements in the array. //! Synonymous with numel(). //! @note This method is deprecated in favour of numel(). - GCC_ATTR_DEPRECATED octave_idx_type nelem (void) const { return numel (); } + OCTAVE_DEPRECATED octave_idx_type nelem (void) const { return numel (); } //! Number of elements in the array. octave_idx_type numel (void) const { return slice_len; }
--- a/liboctave/array/DiagArray2.h Tue Jan 05 13:04:02 2016 -0800 +++ b/liboctave/array/DiagArray2.h Tue Jan 05 14:16:58 2016 -0800 @@ -97,7 +97,7 @@ dim_vector dims (void) const { return dim_vector (d1, d2); } - GCC_ATTR_DEPRECATED Array<T> diag (octave_idx_type k = 0) const; + OCTAVE_DEPRECATED Array<T> diag (octave_idx_type k = 0) const; Array<T> extract_diag (octave_idx_type k = 0) const; DiagArray2<T> build_diag_matrix () const {
--- a/liboctave/array/PermMatrix.h Tue Jan 05 13:04:02 2016 -0800 +++ b/liboctave/array/PermMatrix.h Tue Jan 05 14:16:58 2016 -0800 @@ -37,13 +37,13 @@ PermMatrix (octave_idx_type n); - GCC_ATTR_DEPRECATED PermMatrix (const Array<octave_idx_type>& p); + OCTAVE_DEPRECATED PermMatrix (const Array<octave_idx_type>& p); PermMatrix (const Array<octave_idx_type>& p, bool colp, bool check = true); PermMatrix (const PermMatrix& m) : Array<octave_idx_type> (m) { } - GCC_ATTR_DEPRECATED PermMatrix (const idx_vector& idx); + OCTAVE_DEPRECATED PermMatrix (const idx_vector& idx); PermMatrix (const idx_vector& idx, bool colp, octave_idx_type n = 0); @@ -61,7 +61,7 @@ // FIXME: a dangerous ambiguity? octave_idx_type length (void) const { return perm_length (); } - GCC_ATTR_DEPRECATED octave_idx_type nelem (void) const { return numel (); } + OCTAVE_DEPRECATED octave_idx_type nelem (void) const { return numel (); } octave_idx_type numel (void) const { return dim1 () * dim2 (); } size_t byte_size (void) const
--- a/liboctave/array/Range.h Tue Jan 05 13:04:02 2016 -0800 +++ b/liboctave/array/Range.h Tue Jan 05 14:16:58 2016 -0800 @@ -98,7 +98,7 @@ double base (void) const { return rng_base; } double limit (void) const { return rng_limit; } double inc (void) const { return rng_inc; } - GCC_ATTR_DEPRECATED octave_idx_type nelem (void) const { return numel (); } + OCTAVE_DEPRECATED octave_idx_type nelem (void) const { return numel (); } octave_idx_type numel (void) const { return rng_numel; } bool is_empty (void) const { return numel () == 0; }
--- a/liboctave/array/Sparse.h Tue Jan 05 13:04:02 2016 -0800 +++ b/liboctave/array/Sparse.h Tue Jan 05 14:16:58 2016 -0800 @@ -245,7 +245,7 @@ octave_idx_type nzmax (void) const { return rep->length (); } //! Amount of storage for nonzero elements. //! Synonymous with nzmax(). - GCC_ATTR_DEPRECATED octave_idx_type capacity (void) const { return nzmax (); } + OCTAVE_DEPRECATED octave_idx_type capacity (void) const { return nzmax (); } //! Actual number of nonzero terms. octave_idx_type nnz (void) const { return rep->nnz (); } @@ -256,8 +256,8 @@ return dimensions.safe_numel (); } - GCC_ATTR_DEPRECATED octave_idx_type nelem (void) const { return nzmax (); } - GCC_ATTR_DEPRECATED octave_idx_type length (void) const { return numel (); } + OCTAVE_DEPRECATED octave_idx_type nelem (void) const { return nzmax (); } + OCTAVE_DEPRECATED octave_idx_type length (void) const { return numel (); } octave_idx_type dim1 (void) const { return dimensions(0); } octave_idx_type dim2 (void) const { return dimensions(1); }
--- a/liboctave/array/dSparse.h Tue Jan 05 13:04:02 2016 -0800 +++ b/liboctave/array/dSparse.h Tue Jan 05 14:16:58 2016 -0800 @@ -121,13 +121,13 @@ friend OCTAVE_API SparseMatrix real (const SparseComplexMatrix& a); friend OCTAVE_API SparseMatrix imag (const SparseComplexMatrix& a); - GCC_ATTR_DEPRECATED OCTAVE_API friend + OCTAVE_DEPRECATED OCTAVE_API friend SparseMatrix atan2 (const double& x, const SparseMatrix& y); - GCC_ATTR_DEPRECATED OCTAVE_API friend + OCTAVE_DEPRECATED OCTAVE_API friend SparseMatrix atan2 (const SparseMatrix& x, const double& y); - GCC_ATTR_DEPRECATED OCTAVE_API friend + OCTAVE_DEPRECATED OCTAVE_API friend SparseMatrix atan2 (const SparseMatrix& x, const SparseMatrix& y); SparseMatrix transpose (void) const
--- a/liboctave/cruft/misc/f77-fcn.h Tue Jan 05 13:04:02 2016 -0800 +++ b/liboctave/cruft/misc/f77-fcn.h Tue Jan 05 14:16:58 2016 -0800 @@ -283,7 +283,7 @@ cs[F77_CHAR_ARG_LEN_USE(s, len)] = '\0' -GCC_ATTR_NORETURN CRUFT_API extern +OCTAVE_NORETURN CRUFT_API extern F77_RET_T F77_FUNC (xstopx, XSTOPX) (F77_CONST_CHAR_ARG_DECL F77_CHAR_ARG_LEN_DECL);
--- a/liboctave/cruft/misc/lo-error.c Tue Jan 05 13:04:02 2016 -0800 +++ b/liboctave/cruft/misc/lo-error.c Tue Jan 05 14:16:58 2016 -0800 @@ -34,11 +34,11 @@ symbol errors when creating shared versions of libcruft. */ /* Pointer to the current error handling function. */ -GCC_ATTR_NORETURN liboctave_error_handler current_liboctave_error_handler +OCTAVE_NORETURN liboctave_error_handler current_liboctave_error_handler = liboctave_fatal; /* Pointer to the current error_with_id handling function. */ -GCC_ATTR_NORETURN liboctave_error_with_id_handler current_liboctave_error_with_id_handler +OCTAVE_NORETURN liboctave_error_with_id_handler current_liboctave_error_with_id_handler = liboctave_fatal_with_id; /* Pointer to the current warning handler. */ @@ -61,7 +61,7 @@ } void -set_liboctave_error_handler (GCC_ATTR_NORETURN liboctave_error_handler f) +set_liboctave_error_handler (OCTAVE_NORETURN liboctave_error_handler f) { if (f) current_liboctave_error_handler = f; @@ -70,7 +70,7 @@ } void -set_liboctave_error_with_id_handler (GCC_ATTR_NORETURN liboctave_error_with_id_handler f) +set_liboctave_error_with_id_handler (OCTAVE_NORETURN liboctave_error_with_id_handler f) { if (f) current_liboctave_error_with_id_handler = f;
--- a/liboctave/cruft/misc/lo-error.h Tue Jan 05 13:04:02 2016 -0800 +++ b/liboctave/cruft/misc/lo-error.h Tue Jan 05 14:16:58 2016 -0800 @@ -27,9 +27,9 @@ extern "C" { #endif -GCC_ATTR_NORETURN extern void liboctave_fatal (const char *fmt, ...); +OCTAVE_NORETURN extern void liboctave_fatal (const char *fmt, ...); -GCC_ATTR_NORETURN extern +OCTAVE_NORETURN extern void liboctave_fatal_with_id (const char *id, const char *fmt, ...); extern void liboctave_warning (const char *fmt, ...); @@ -46,17 +46,17 @@ /* Would be nice to make these pointers private, but we want to share them among all the liboctave classes. */ -GCC_ATTR_NORETURN CRUFT_API extern liboctave_error_handler current_liboctave_error_handler; +OCTAVE_NORETURN CRUFT_API extern liboctave_error_handler current_liboctave_error_handler; -GCC_ATTR_NORETURN CRUFT_API extern liboctave_error_with_id_handler current_liboctave_error_with_id_handler; +OCTAVE_NORETURN CRUFT_API extern liboctave_error_with_id_handler current_liboctave_error_with_id_handler; CRUFT_API extern liboctave_warning_handler current_liboctave_warning_handler; CRUFT_API extern liboctave_warning_with_id_handler current_liboctave_warning_with_id_handler; -CRUFT_API extern void set_liboctave_error_handler (GCC_ATTR_NORETURN liboctave_error_handler f); +CRUFT_API extern void set_liboctave_error_handler (OCTAVE_NORETURN liboctave_error_handler f); -CRUFT_API extern void set_liboctave_error_with_id_handler (GCC_ATTR_NORETURN liboctave_error_with_id_handler f); +CRUFT_API extern void set_liboctave_error_with_id_handler (OCTAVE_NORETURN liboctave_error_with_id_handler f); CRUFT_API extern void set_liboctave_warning_handler (liboctave_warning_handler f);
--- a/liboctave/cruft/misc/quit.h Tue Jan 05 13:04:02 2016 -0800 +++ b/liboctave/cruft/misc/quit.h Tue Jan 05 14:16:58 2016 -0800 @@ -66,7 +66,7 @@ CRUFT_API extern void octave_restore_current_context (void *); -GCC_ATTR_NORETURN CRUFT_API extern void octave_jump_to_enclosing_context (void); +OCTAVE_NORETURN CRUFT_API extern void octave_jump_to_enclosing_context (void); CRUFT_API extern void octave_save_signal_mask (void); @@ -141,11 +141,11 @@ CRUFT_API extern void octave_handle_signal (void); -GCC_ATTR_NORETURN CRUFT_API extern void octave_throw_interrupt_exception (void); +OCTAVE_NORETURN CRUFT_API extern void octave_throw_interrupt_exception (void); -GCC_ATTR_NORETURN CRUFT_API extern void octave_throw_execution_exception (void); +OCTAVE_NORETURN CRUFT_API extern void octave_throw_execution_exception (void); -GCC_ATTR_NORETURN CRUFT_API extern void octave_throw_bad_alloc (void); +OCTAVE_NORETURN CRUFT_API extern void octave_throw_bad_alloc (void); CRUFT_API extern void octave_rethrow_exception (void);
--- a/liboctave/numeric/SparseCmplxQR.cc Tue Jan 05 13:04:02 2016 -0800 +++ b/liboctave/numeric/SparseCmplxQR.cc Tue Jan 05 14:16:58 2016 -0800 @@ -49,7 +49,7 @@ #endif SparseComplexQR::SparseComplexQR_rep::SparseComplexQR_rep - (GCC_ATTR_UNUSED const SparseComplexMatrix& a, GCC_ATTR_UNUSED int order) + (OCTAVE_UNUSED const SparseComplexMatrix& a, OCTAVE_UNUSED int order) : count (1), nrows (0) #ifdef HAVE_CXSPARSE , S (0), N (0)
--- a/liboctave/util/lo-array-gripes.h Tue Jan 05 13:04:02 2016 -0800 +++ b/liboctave/util/lo-array-gripes.h Tue Jan 05 14:16:58 2016 -0800 @@ -109,56 +109,56 @@ extern OCTAVE_API const char *warning_id_singular_matrix; -GCC_ATTR_NORETURN OCTAVE_API extern void +OCTAVE_NORETURN OCTAVE_API extern void gripe_nan_to_logical_conversion (void); -GCC_ATTR_NORETURN OCTAVE_API extern void +OCTAVE_NORETURN OCTAVE_API extern void gripe_nan_to_character_conversion (void); -GCC_ATTR_NORETURN OCTAVE_API extern void +OCTAVE_NORETURN OCTAVE_API extern void gripe_nonconformant (const char *op, octave_idx_type op1_len, octave_idx_type op2_len); -GCC_ATTR_NORETURN OCTAVE_API extern void +OCTAVE_NORETURN OCTAVE_API extern void 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); -GCC_ATTR_NORETURN OCTAVE_API extern void +OCTAVE_NORETURN OCTAVE_API extern void gripe_nonconformant (const char *op, const dim_vector& op1_dims, const dim_vector& op2_dims); -GCC_ATTR_NORETURN OCTAVE_API extern void +OCTAVE_NORETURN OCTAVE_API extern void gripe_index_out_of_range (int nd, int dim, octave_idx_type iext, octave_idx_type ext, const dim_vector& d); -GCC_ATTR_NORETURN OCTAVE_API extern void +OCTAVE_NORETURN OCTAVE_API extern void gripe_index_out_of_range (int nd, int dim, octave_idx_type iext, octave_idx_type ext); -GCC_ATTR_NORETURN OCTAVE_API extern void +OCTAVE_NORETURN OCTAVE_API extern void gripe_del_index_out_of_range (bool is1d, octave_idx_type iext, octave_idx_type ext); -GCC_ATTR_NORETURN OCTAVE_API extern void +OCTAVE_NORETURN OCTAVE_API extern void gripe_invalid_index (double, octave_idx_type nd = 0, octave_idx_type dim = 0, const std::string& var = ""); -GCC_ATTR_NORETURN OCTAVE_API extern void +OCTAVE_NORETURN OCTAVE_API extern void gripe_invalid_index (octave_idx_type n, octave_idx_type nd = 0, octave_idx_type dim = 0, const std::string& var = ""); -GCC_ATTR_NORETURN OCTAVE_API extern void +OCTAVE_NORETURN OCTAVE_API extern void gripe_invalid_index (const std::string& idx, octave_idx_type nd = 0, octave_idx_type dim = 0, const std::string& var = ""); -GCC_ATTR_NORETURN OCTAVE_API extern void +OCTAVE_NORETURN OCTAVE_API extern void gripe_invalid_resize (void); extern void OCTAVE_API
--- a/liboctave/util/unwind-prot.h Tue Jan 05 13:04:02 2016 -0800 +++ b/liboctave/util/unwind-prot.h Tue Jan 05 14:16:58 2016 -0800 @@ -50,14 +50,14 @@ lifo.push (new_elem); } - GCC_ATTR_DEPRECATED void add (void (*fcn) (void *), void *ptr = 0) + OCTAVE_DEPRECATED void add (void (*fcn) (void *), void *ptr = 0) { add (new fcn_arg_elem<void *> (fcn, ptr)); } operator bool (void) const { return ! empty (); } - GCC_ATTR_DEPRECATED void run_top (void) { run_first (); } + OCTAVE_DEPRECATED void run_top (void) { run_first (); } void run_first (void) { @@ -70,9 +70,9 @@ } } - GCC_ATTR_DEPRECATED void run_top (int num) { run (num); } + OCTAVE_DEPRECATED void run_top (int num) { run (num); } - GCC_ATTR_DEPRECATED void discard_top (void) { discard_first (); } + OCTAVE_DEPRECATED void discard_top (void) { discard_first (); } void discard_first (void) { @@ -84,7 +84,7 @@ } } - GCC_ATTR_DEPRECATED void discard_top (int num) { discard (num); } + OCTAVE_DEPRECATED void discard_top (int num) { discard (num); } size_t size (void) const { return lifo.size (); }
--- a/oct-conf-post.in.h Tue Jan 05 13:04:02 2016 -0800 +++ b/oct-conf-post.in.h Tue Jan 05 14:16:58 2016 -0800 @@ -24,19 +24,29 @@ #define GNULIB_NAMESPACE gnulib #endif -#if defined (__GNUC__) -#define GCC_ATTR_DEPRECATED __attribute__ ((__deprecated__)) -#define HAVE_ATTR_DEPRECATED - -#define GCC_ATTR_NORETURN __attribute__ ((__noreturn__)) -#define HAVE_ATTR_NORETURN +// The C++ standard is evolving to allow attribute hints in a +// compiler-independent manner. In C++ 2011 support for noreturn was added. +// In C++ 2014 support for deprecated was added. The Octave code base has +// been future-proofed by using macros of the form OCTAVE_ATTRIBUTE_NAME in +// place of vendor specific attribute mechanisms. As compilers evolve, the +// underlying implementation can be changed with the macro definitions below. +// FIXME: Update macros to use C++ standard attribute syntax when Octave moves +// to C++ 2011 standard. -#define GCC_ATTR_UNUSED __attribute__ ((__unused__)) -#define HAVE_ATTR_UNUSED +#if defined (__GNUC__) + // The following attributes are used with gcc and clang compilers. + #define OCTAVE_DEPRECATED __attribute__ ((__deprecated__)) + #define HAVE_ATTR_DEPRECATED + + #define OCTAVE_NORETURN __attribute__ ((__noreturn__)) + #define HAVE_ATTR_NORETURN + + #define OCTAVE_UNUSED __attribute__ ((__unused__)) + #define HAVE_ATTR_UNUSED #else -#define GCC_ATTR_DEPRECATED -#define GCC_ATTR_NORETURN -#define GCC_ATTR_UNUSED + #define OCTAVE_DEPRECATED + #define OCTAVE_NORETURN + #define OCTAVE_UNUSED #endif #define X_CAST(T, E) (T) (E) @@ -118,6 +128,9 @@ /* oct-dlldefs.h */ +// FIXME: GCC supports visibility attributes as well, even using the +// same __declspec declaration if desired. The build system should be +// extended to support GCC and visibility attributes. #if defined (_MSC_VER) #define OCTAVE_EXPORT __declspec(dllexport) #define OCTAVE_IMPORT __declspec(dllimport)