From: Jon Purdy Date: Thu, 2 Feb 2017 23:42:45 +0000 (-0800) Subject: [runtime] Use double-underscored attributes. X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=f138f07d160166d5b2c67dadfd24ab836c2c292e;p=mono.git [runtime] Use double-underscored attributes. E.g., 'aligned' => '__aligned__'. We use the following attributes: * aligned * always_inline * cold * deprecated * error * format * naked * noinline * packed * printf * tls_model * unavailable * used * visibility * warn_unused_result --- diff --git a/mono/arch/s390x/s390x-codegen.h b/mono/arch/s390x/s390x-codegen.h index 97db6ce6eb9..880eca2201c 100644 --- a/mono/arch/s390x/s390x-codegen.h +++ b/mono/arch/s390x/s390x-codegen.h @@ -268,7 +268,7 @@ typedef struct { char xx : 4; char r3 : 4; char r4 : 4; -} __attribute__ ((packed)) RRD_Format; +} __attribute__ ((__packed__)) RRD_Format; typedef struct { short op; @@ -346,7 +346,7 @@ typedef struct { int b2 : 4; int d2 : 20; char op2; -} __attribute__ ((packed)) RXY_Format; +} __attribute__ ((__packed__)) RXY_Format; typedef struct { char op; @@ -381,7 +381,7 @@ typedef struct { short dl2 : 12; char dh2; char op2; -} __attribute__ ((packed)) RSY_Format_1; +} __attribute__ ((__packed__)) RSY_Format_1; typedef struct { char op1; @@ -391,7 +391,7 @@ typedef struct { short dl2 : 12; char dh2; char op2; -} __attribute__ ((packed)) RSY_Format_2; +} __attribute__ ((__packed__)) RSY_Format_2; typedef struct { char op1; @@ -401,21 +401,21 @@ typedef struct { short d1 : 12; char yy; char op2; -} __attribute__ ((packed)) RSL_Format; +} __attribute__ ((__packed__)) RSL_Format; typedef struct { char op; char r1 : 4; char r3 : 4; short i2; -} __attribute__ ((packed)) RSI_Format; +} __attribute__ ((__packed__)) RSI_Format; typedef struct { char op1; char m1 : 4; char op2 : 4; short i2; -} __attribute__ ((packed)) RI_Format; +} __attribute__ ((__packed__)) RI_Format; typedef struct { char op1; @@ -424,7 +424,7 @@ typedef struct { short i2; char xx; char op2; -} __attribute__ ((packed)) RIE_Format_1; +} __attribute__ ((__packed__)) RIE_Format_1; typedef struct { char op1; @@ -434,7 +434,7 @@ typedef struct { char m2 : 4; char xx : 4; char op2; -} __attribute__ ((packed)) RIE_Format_2; +} __attribute__ ((__packed__)) RIE_Format_2; typedef struct { char op1; @@ -443,7 +443,7 @@ typedef struct { short d; char i; char op2; -} __attribute__ ((packed)) RIE_Format_3; +} __attribute__ ((__packed__)) RIE_Format_3; typedef struct { char op1; @@ -453,7 +453,7 @@ typedef struct { char m3 : 4; char xx : 4; char op2; -} __attribute__ ((packed)) RIE_Format_4; +} __attribute__ ((__packed__)) RIE_Format_4; typedef struct { char op1; @@ -462,7 +462,7 @@ typedef struct { short ri2; char xx; char op2; -} __attribute__ ((packed)) RIE_Format_5; +} __attribute__ ((__packed__)) RIE_Format_5; typedef struct { char op1; @@ -472,7 +472,7 @@ typedef struct { char i4; char i5; char op2; -} __attribute__ ((packed)) RIE_Format_6; +} __attribute__ ((__packed__)) RIE_Format_6; typedef struct { char op1; @@ -481,7 +481,7 @@ typedef struct { short i2; char xx; char op2; -} __attribute__ ((packed)) RIE_Format_7; +} __attribute__ ((__packed__)) RIE_Format_7; typedef struct { char op1; @@ -491,21 +491,21 @@ typedef struct { int d4 : 12; char i2; char op2; -} __attribute__ ((packed)) RIS_Format; +} __attribute__ ((__packed__)) RIS_Format; typedef struct { char op1; char r1 : 4; char op2 : 4; int i2; -} __attribute__ ((packed)) RIL_Format_1; +} __attribute__ ((__packed__)) RIL_Format_1; typedef struct { char op1; char m1 : 4; char op2 : 4; int i2; -} __attribute__ ((packed)) RIL_Format_2; +} __attribute__ ((__packed__)) RIL_Format_2; typedef struct { short op1; @@ -516,21 +516,21 @@ typedef struct { char m3 : 4; char xx : 4; char op2; -} __attribute__ ((packed)) RXE_Format; +} __attribute__ ((__packed__)) RXE_Format; typedef struct { char op; char i2; short b1 : 4; short d1 : 12; -} __attribute__ ((packed)) SI_Format; +} __attribute__ ((__packed__)) SI_Format; typedef struct { short op; char b1 : 4; short d1 : 12; short i2; -} __attribute__ ((packed)) SIL_Format; +} __attribute__ ((__packed__)) SIL_Format; typedef struct { char op1; @@ -538,7 +538,7 @@ typedef struct { char b1 : 4; int d1 : 20; char op2; -} __attribute__ ((packed)) SIY_Format; +} __attribute__ ((__packed__)) SIY_Format; typedef struct { char op1; @@ -547,13 +547,13 @@ typedef struct { short b3 : 4; short d3 : 12; short ri2; -} __attribute__ ((packed)) SMI_Format; +} __attribute__ ((__packed__)) SMI_Format; typedef struct { short op; short b2 : 4; short d2 : 12; -} __attribute__ ((packed)) S_Format; +} __attribute__ ((__packed__)) S_Format; typedef struct { char op; @@ -562,7 +562,7 @@ typedef struct { short d1 : 12; short b2 : 4; short d2 : 12; -} __attribute__ ((packed)) SS_Format_1; +} __attribute__ ((__packed__)) SS_Format_1; typedef struct { char op; @@ -572,7 +572,7 @@ typedef struct { short d1 : 12; short b2 : 4; short d2 : 12; -} __attribute__ ((packed)) SS_Format_2; +} __attribute__ ((__packed__)) SS_Format_2; typedef struct { char op; @@ -582,7 +582,7 @@ typedef struct { short d1 : 12; short b2 : 4; short d2 : 12; -} __attribute__ ((packed)) SS_Format_3; +} __attribute__ ((__packed__)) SS_Format_3; typedef struct { char op; @@ -592,7 +592,7 @@ typedef struct { short d2 : 12; short b4 : 4; short d4 : 12; -} __attribute__ ((packed)) SS_Format_4; +} __attribute__ ((__packed__)) SS_Format_4; typedef struct { short op; @@ -600,7 +600,7 @@ typedef struct { short d1 : 12; short b2 : 4; short d2 : 12; -} __attribute__ ((packed)) SSE_Format; +} __attribute__ ((__packed__)) SSE_Format; typedef struct { short op; @@ -610,7 +610,7 @@ typedef struct { short d1 : 12; short b2 : 4; short d2 : 12; -} __attribute__ ((packed)) SSF_Format; +} __attribute__ ((__packed__)) SSF_Format; typedef struct { short op1; @@ -620,7 +620,7 @@ typedef struct { char m3 : 4; char rxb : 4; char op2; -} __attribute__ ((packed)) VRIa_Format; +} __attribute__ ((__packed__)) VRIa_Format; typedef struct { short op1; @@ -631,7 +631,7 @@ typedef struct { char m4 : 4; char rxb : 4; char op2; -} __attribute__ ((packed)) VRIb_Format; +} __attribute__ ((__packed__)) VRIb_Format; typedef struct { short op1; @@ -641,7 +641,7 @@ typedef struct { char m4 : 4; char rxb : 4; char op2; -} __attribute__ ((packed)) VRIc_Format; +} __attribute__ ((__packed__)) VRIc_Format; typedef struct { short op1; @@ -653,7 +653,7 @@ typedef struct { char m5 : 4; char rxb : 4; char op2; -} __attribute__ ((packed)) VRId_Format; +} __attribute__ ((__packed__)) VRId_Format; typedef struct { short op1; @@ -664,7 +664,7 @@ typedef struct { char m4 : 4; char rxb : 4; char op2; -} __attribute__ ((packed)) VRIe_Format; +} __attribute__ ((__packed__)) VRIe_Format; typedef struct { short op1; @@ -676,7 +676,7 @@ typedef struct { char m3 : 4; char rxb : 4; char op2; -} __attribute__ ((packed)) VRRa_Format; +} __attribute__ ((__packed__)) VRRa_Format; typedef struct { short op1; @@ -689,7 +689,7 @@ typedef struct { char m4 : 4; char rxb : 4; char op2; -} __attribute__ ((packed)) VRRb_Format; +} __attribute__ ((__packed__)) VRRb_Format; typedef struct { short op1; @@ -702,7 +702,7 @@ typedef struct { char m3 : 4; char rxb : 4; char op2; -} __attribute__ ((packed)) VRRc_Format; +} __attribute__ ((__packed__)) VRRc_Format; typedef struct { short op1; @@ -715,7 +715,7 @@ typedef struct { char v4 : 4; char rxb : 4; char op2; -} __attribute__ ((packed)) VRRd_Format; +} __attribute__ ((__packed__)) VRRd_Format; typedef struct { short op1; @@ -728,7 +728,7 @@ typedef struct { char v4 : 4; char rxb : 4; char op2; -} __attribute__ ((packed)) VRRe_Format; +} __attribute__ ((__packed__)) VRRe_Format; typedef struct { short op1; @@ -738,7 +738,7 @@ typedef struct { short xx; char rxb : 4; char op2; -} __attribute__ ((packed)) VRRf_Format; +} __attribute__ ((__packed__)) VRRf_Format; typedef struct { short op1; @@ -749,7 +749,7 @@ typedef struct { char m4 : 4; char rxb : 4; char op2; -} __attribute__ ((packed)) VRSa_Format; +} __attribute__ ((__packed__)) VRSa_Format; typedef struct { short op1; @@ -760,7 +760,7 @@ typedef struct { char m4 : 4; char rxb : 4; char op2; -} __attribute__ ((packed)) VRSb_Format; +} __attribute__ ((__packed__)) VRSb_Format; typedef struct { short op1; @@ -771,7 +771,7 @@ typedef struct { char m4 : 4; char rxb : 4; char op2; -} __attribute__ ((packed)) VRSc_Format; +} __attribute__ ((__packed__)) VRSc_Format; typedef struct { short op1; @@ -782,7 +782,7 @@ typedef struct { char m3 : 4; char rxb : 4; char op2; -} __attribute__ ((packed)) VRV_Format; +} __attribute__ ((__packed__)) VRV_Format; typedef struct { short op1; @@ -793,7 +793,7 @@ typedef struct { char m3 : 4; char rxb : 4; char op2; -} __attribute__ ((packed)) VRX_Format; +} __attribute__ ((__packed__)) VRX_Format; #define s390_emit16(c, x) do \ { \ diff --git a/mono/btls/btls-util.h b/mono/btls/btls-util.h index a1b165235bd..cad0920391d 100644 --- a/mono/btls/btls-util.h +++ b/mono/btls/btls-util.h @@ -22,7 +22,7 @@ #else #ifdef __GNUC__ -#define MONO_API __attribute__ ((visibility ("default"))) +#define MONO_API __attribute__ ((__visibility__ ("default"))) #else #define MONO_API #endif diff --git a/mono/metadata/sgen-client-mono.h b/mono/metadata/sgen-client-mono.h index 6db0af190c9..836c1143d7a 100644 --- a/mono/metadata/sgen-client-mono.h +++ b/mono/metadata/sgen-client-mono.h @@ -112,7 +112,7 @@ sgen_mono_array_size (GCVTable vtable, MonoArray *array, mword *bounds_size, mwo #define SGEN_CLIENT_OBJECT_HEADER_SIZE (sizeof (GCObject)) #define SGEN_CLIENT_MINIMUM_OBJECT_SIZE SGEN_CLIENT_OBJECT_HEADER_SIZE -static mword /*__attribute__((noinline)) not sure if this hint is a good idea*/ +static mword /*__attribute__ ((__noinline__)) not sure if this hint is a good idea*/ sgen_client_slow_object_get_size (GCVTable vtable, GCObject* o) { MonoClass *klass = ((MonoVTable*)vtable)->klass; diff --git a/mono/mini/mini-arm64.c b/mono/mini/mini-arm64.c index 200036dddd5..3ad91e31cd0 100644 --- a/mono/mini/mini-arm64.c +++ b/mono/mini/mini-arm64.c @@ -53,7 +53,7 @@ static gpointer bp_trampoline; static gboolean ios_abi; -static __attribute__((warn_unused_result)) guint8* emit_load_regset (guint8 *code, guint64 regs, int basereg, int offset); +static __attribute__ ((__warn_unused_result__)) guint8* emit_load_regset (guint8 *code, guint64 regs, int basereg, int offset); const char* mono_arch_regname (int reg) @@ -328,7 +328,7 @@ emit_imm64_template (guint8 *code, int dreg) return code; } -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_addw_imm (guint8 *code, int dreg, int sreg, int imm) { if (!arm_is_arith_imm (imm)) { @@ -340,7 +340,7 @@ emit_addw_imm (guint8 *code, int dreg, int sreg, int imm) return code; } -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_addx_imm (guint8 *code, int dreg, int sreg, int imm) { if (!arm_is_arith_imm (imm)) { @@ -352,7 +352,7 @@ emit_addx_imm (guint8 *code, int dreg, int sreg, int imm) return code; } -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_subw_imm (guint8 *code, int dreg, int sreg, int imm) { if (!arm_is_arith_imm (imm)) { @@ -364,7 +364,7 @@ emit_subw_imm (guint8 *code, int dreg, int sreg, int imm) return code; } -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_subx_imm (guint8 *code, int dreg, int sreg, int imm) { if (!arm_is_arith_imm (imm)) { @@ -377,7 +377,7 @@ emit_subx_imm (guint8 *code, int dreg, int sreg, int imm) } /* Emit sp+=imm. Clobbers ip0/ip1 */ -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_addx_sp_imm (guint8 *code, int imm) { code = emit_imm (code, ARMREG_IP0, imm); @@ -388,7 +388,7 @@ emit_addx_sp_imm (guint8 *code, int imm) } /* Emit sp-=imm. Clobbers ip0/ip1 */ -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_subx_sp_imm (guint8 *code, int imm) { code = emit_imm (code, ARMREG_IP0, imm); @@ -398,7 +398,7 @@ emit_subx_sp_imm (guint8 *code, int imm) return code; } -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_andw_imm (guint8 *code, int dreg, int sreg, int imm) { // FIXME: @@ -408,7 +408,7 @@ emit_andw_imm (guint8 *code, int dreg, int sreg, int imm) return code; } -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_andx_imm (guint8 *code, int dreg, int sreg, int imm) { // FIXME: @@ -418,7 +418,7 @@ emit_andx_imm (guint8 *code, int dreg, int sreg, int imm) return code; } -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_orrw_imm (guint8 *code, int dreg, int sreg, int imm) { // FIXME: @@ -428,7 +428,7 @@ emit_orrw_imm (guint8 *code, int dreg, int sreg, int imm) return code; } -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_orrx_imm (guint8 *code, int dreg, int sreg, int imm) { // FIXME: @@ -438,7 +438,7 @@ emit_orrx_imm (guint8 *code, int dreg, int sreg, int imm) return code; } -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_eorw_imm (guint8 *code, int dreg, int sreg, int imm) { // FIXME: @@ -448,7 +448,7 @@ emit_eorw_imm (guint8 *code, int dreg, int sreg, int imm) return code; } -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_eorx_imm (guint8 *code, int dreg, int sreg, int imm) { // FIXME: @@ -458,7 +458,7 @@ emit_eorx_imm (guint8 *code, int dreg, int sreg, int imm) return code; } -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_cmpw_imm (guint8 *code, int sreg, int imm) { if (imm == 0) { @@ -472,7 +472,7 @@ emit_cmpw_imm (guint8 *code, int sreg, int imm) return code; } -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_cmpx_imm (guint8 *code, int sreg, int imm) { if (imm == 0) { @@ -486,7 +486,7 @@ emit_cmpx_imm (guint8 *code, int sreg, int imm) return code; } -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_strb (guint8 *code, int rt, int rn, int imm) { if (arm_is_strb_imm (imm)) { @@ -500,7 +500,7 @@ emit_strb (guint8 *code, int rt, int rn, int imm) return code; } -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_strh (guint8 *code, int rt, int rn, int imm) { if (arm_is_strh_imm (imm)) { @@ -514,7 +514,7 @@ emit_strh (guint8 *code, int rt, int rn, int imm) return code; } -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_strw (guint8 *code, int rt, int rn, int imm) { if (arm_is_strw_imm (imm)) { @@ -528,7 +528,7 @@ emit_strw (guint8 *code, int rt, int rn, int imm) return code; } -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_strfpw (guint8 *code, int rt, int rn, int imm) { if (arm_is_strw_imm (imm)) { @@ -542,7 +542,7 @@ emit_strfpw (guint8 *code, int rt, int rn, int imm) return code; } -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_strfpx (guint8 *code, int rt, int rn, int imm) { if (arm_is_strx_imm (imm)) { @@ -556,7 +556,7 @@ emit_strfpx (guint8 *code, int rt, int rn, int imm) return code; } -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_strx (guint8 *code, int rt, int rn, int imm) { if (arm_is_strx_imm (imm)) { @@ -570,7 +570,7 @@ emit_strx (guint8 *code, int rt, int rn, int imm) return code; } -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_ldrb (guint8 *code, int rt, int rn, int imm) { if (arm_is_pimm12_scaled (imm, 1)) { @@ -584,7 +584,7 @@ emit_ldrb (guint8 *code, int rt, int rn, int imm) return code; } -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_ldrsbx (guint8 *code, int rt, int rn, int imm) { if (arm_is_pimm12_scaled (imm, 1)) { @@ -598,7 +598,7 @@ emit_ldrsbx (guint8 *code, int rt, int rn, int imm) return code; } -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_ldrh (guint8 *code, int rt, int rn, int imm) { if (arm_is_pimm12_scaled (imm, 2)) { @@ -612,7 +612,7 @@ emit_ldrh (guint8 *code, int rt, int rn, int imm) return code; } -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_ldrshx (guint8 *code, int rt, int rn, int imm) { if (arm_is_pimm12_scaled (imm, 2)) { @@ -626,7 +626,7 @@ emit_ldrshx (guint8 *code, int rt, int rn, int imm) return code; } -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_ldrswx (guint8 *code, int rt, int rn, int imm) { if (arm_is_pimm12_scaled (imm, 4)) { @@ -640,7 +640,7 @@ emit_ldrswx (guint8 *code, int rt, int rn, int imm) return code; } -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_ldrw (guint8 *code, int rt, int rn, int imm) { if (arm_is_pimm12_scaled (imm, 4)) { @@ -653,7 +653,7 @@ emit_ldrw (guint8 *code, int rt, int rn, int imm) return code; } -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_ldrx (guint8 *code, int rt, int rn, int imm) { if (arm_is_pimm12_scaled (imm, 8)) { @@ -666,7 +666,7 @@ emit_ldrx (guint8 *code, int rt, int rn, int imm) return code; } -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_ldrfpw (guint8 *code, int rt, int rn, int imm) { if (arm_is_pimm12_scaled (imm, 4)) { @@ -680,7 +680,7 @@ emit_ldrfpw (guint8 *code, int rt, int rn, int imm) return code; } -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_ldrfpx (guint8 *code, int rt, int rn, int imm) { if (arm_is_pimm12_scaled (imm, 8)) { @@ -790,7 +790,7 @@ emit_tls_set (guint8 *code, int sreg, int tls_offset) * - ldrp [fp, lr], [sp], !stack_offfset * Clobbers TEMP_REGS. */ -__attribute__((warn_unused_result)) guint8* +__attribute__ ((__warn_unused_result__)) guint8* mono_arm_emit_destroy_frame (guint8 *code, int stack_offset, guint64 temp_regs) { arm_movspx (code, ARMREG_SP, ARMREG_FP); @@ -2854,7 +2854,7 @@ opcode_to_armcond (int opcode) } /* This clobbers LR */ -static inline __attribute__((warn_unused_result)) guint8* +static inline __attribute__ ((__warn_unused_result__)) guint8* emit_cond_exc (MonoCompile *cfg, guint8 *code, int opcode, const char *exc_name) { int cond; @@ -4483,7 +4483,7 @@ emit_move_args (MonoCompile *cfg, guint8 *code) * Emit code to store the registers in REGS into the appropriate elements of * the register array at BASEREG+OFFSET. */ -static __attribute__((warn_unused_result)) guint8* +static __attribute__ ((__warn_unused_result__)) guint8* emit_store_regarray (guint8 *code, guint64 regs, int basereg, int offset) { int i; @@ -4510,7 +4510,7 @@ emit_store_regarray (guint8 *code, guint64 regs, int basereg, int offset) * Emit code to load the registers in REGS from the appropriate elements of * the register array at BASEREG+OFFSET. */ -static __attribute__((warn_unused_result)) guint8* +static __attribute__ ((__warn_unused_result__)) guint8* emit_load_regarray (guint8 *code, guint64 regs, int basereg, int offset) { int i; @@ -4541,7 +4541,7 @@ emit_load_regarray (guint8 *code, guint64 regs, int basereg, int offset) * Emit code to store the registers in REGS into consecutive memory locations starting * at BASEREG+OFFSET. */ -static __attribute__((warn_unused_result)) guint8* +static __attribute__ ((__warn_unused_result__)) guint8* emit_store_regset (guint8 *code, guint64 regs, int basereg, int offset) { int i, pos; @@ -4571,7 +4571,7 @@ emit_store_regset (guint8 *code, guint64 regs, int basereg, int offset) * Emit code to load the registers in REGS from consecutive memory locations starting * at BASEREG+OFFSET. */ -static __attribute__((warn_unused_result)) guint8* +static __attribute__ ((__warn_unused_result__)) guint8* emit_load_regset (guint8 *code, guint64 regs, int basereg, int offset) { int i, pos; @@ -4594,19 +4594,19 @@ emit_load_regset (guint8 *code, guint64 regs, int basereg, int offset) return code; } -__attribute__((warn_unused_result)) guint8* +__attribute__ ((__warn_unused_result__)) guint8* mono_arm_emit_load_regarray (guint8 *code, guint64 regs, int basereg, int offset) { return emit_load_regarray (code, regs, basereg, offset); } -__attribute__((warn_unused_result)) guint8* +__attribute__ ((__warn_unused_result__)) guint8* mono_arm_emit_store_regarray (guint8 *code, guint64 regs, int basereg, int offset) { return emit_store_regarray (code, regs, basereg, offset); } -__attribute__((warn_unused_result)) guint8* +__attribute__ ((__warn_unused_result__)) guint8* mono_arm_emit_store_regset (guint8 *code, guint64 regs, int basereg, int offset) { return emit_store_regset (code, regs, basereg, offset); @@ -4614,7 +4614,7 @@ mono_arm_emit_store_regset (guint8 *code, guint64 regs, int basereg, int offset) /* Same as emit_store_regset, but emit unwind info too */ /* CFA_OFFSET is the offset between the CFA and basereg */ -static __attribute__((warn_unused_result)) guint8* +static __attribute__ ((__warn_unused_result__)) guint8* emit_store_regset_cfa (MonoCompile *cfg, guint8 *code, guint64 regs, int basereg, int offset, int cfa_offset, guint64 no_cfa_regset) { int i, j, pos, nregs; diff --git a/mono/mini/mini-runtime.c b/mono/mini/mini-runtime.c index caace88593a..d9a9dbb8041 100644 --- a/mono/mini/mini-runtime.c +++ b/mono/mini/mini-runtime.c @@ -242,7 +242,7 @@ mono_pmip (void *ip) */ #ifdef __GNUC__ /* Prevent the linker from optimizing this away in embedding setups to help debugging */ - __attribute__((used)) + __attribute__ ((__used__)) #endif void mono_print_method_from_ip (void *ip) diff --git a/mono/mini/mini-s390x.c b/mono/mini/mini-s390x.c index 8cbcd45accc..419c4bf51b5 100644 --- a/mono/mini/mini-s390x.c +++ b/mono/mini/mini-s390x.c @@ -352,7 +352,7 @@ typedef struct { typedef struct { gint64 gr[5]; /* R2-R6 */ gdouble fp[3]; /* F0-F2 */ -} __attribute__ ((packed)) RegParm; +} __attribute__ ((__packed__)) RegParm; typedef struct { RR_Format basr; @@ -360,7 +360,7 @@ typedef struct { void *pTrigger; RXY_Format lg; RXY_Format trigger; -} __attribute__ ((packed)) breakpoint_t; +} __attribute__ ((__packed__)) breakpoint_t; /*========================= End of Typedefs ========================*/ diff --git a/mono/sgen/sgen-protocol.h b/mono/sgen/sgen-protocol.h index b0892f4478f..f0da36fd73d 100644 --- a/mono/sgen/sgen-protocol.h +++ b/mono/sgen/sgen-protocol.h @@ -83,7 +83,7 @@ enum { #define PROTOCOL_PACK_STRUCTS #if defined(__GNUC__) -#define PROTOCOL_STRUCT_ATTR __attribute__ ((packed)) +#define PROTOCOL_STRUCT_ATTR __attribute__ ((__packed__)) #else #define PROTOCOL_STRUCT_ATTR #endif diff --git a/mono/tests/libtest.c b/mono/tests/libtest.c index 774a0ce1022..ad4a8fc9bac 100644 --- a/mono/tests/libtest.c +++ b/mono/tests/libtest.c @@ -34,7 +34,7 @@ typedef int (STDCALL *SimpleDelegate) (int a); #if defined(WIN32) && defined (_MSC_VER) #define LIBTEST_API __declspec(dllexport) #elif defined(__GNUC__) -#define LIBTEST_API __attribute__ ((visibility ("default"))) +#define LIBTEST_API __attribute__ ((__visibility__ ("default"))) #else #define LIBTEST_API #endif @@ -3577,7 +3577,7 @@ mono_test_marshal_ccw_itest (MonoComObject *pUnk) */ #if defined(__GNUC__) && ((defined(__i386__) && (defined(__linux__) || defined (__APPLE__)) || defined (__FreeBSD__) || defined(__OpenBSD__)) || (defined(__ppc__) && defined(__APPLE__))) -#define ALIGN(size) __attribute__ ((aligned(size))) +#define ALIGN(size) __attribute__ ((__aligned__(size))) #else #define ALIGN(size) #endif diff --git a/mono/utils/atomic.c b/mono/utils/atomic.c index 543e8ce9b0c..748720ad95e 100644 --- a/mono/utils/atomic.c +++ b/mono/utils/atomic.c @@ -524,7 +524,7 @@ InterlockedCompareExchange64(volatile gint64 *dest, gint64 exch, gint64 comp) * so we have to roll our own... */ -gint64 InterlockedCompareExchange64(volatile gint64 *dest, gint64 exch, gint64 comp) __attribute__ ((naked)); +gint64 InterlockedCompareExchange64(volatile gint64 *dest, gint64 exch, gint64 comp) __attribute__ ((__naked__)); gint64 InterlockedCompareExchange64(volatile gint64 *dest, gint64 exch, gint64 comp) diff --git a/mono/utils/mono-compiler.h b/mono/utils/mono-compiler.h index 8d83f5d672e..f3371b4be1f 100644 --- a/mono/utils/mono-compiler.h +++ b/mono/utils/mono-compiler.h @@ -8,13 +8,13 @@ #include #ifdef __GNUC__ -#define MONO_ATTR_USED __attribute__ ((used)) +#define MONO_ATTR_USED __attribute__ ((__used__)) #else #define MONO_ATTR_USED #endif #ifdef __GNUC__ -#define MONO_ATTR_FORMAT_PRINTF(fmt_pos,arg_pos) __attribute__((format(printf,fmt_pos,arg_pos))) +#define MONO_ATTR_FORMAT_PRINTF(fmt_pos,arg_pos) __attribute__ ((__format__(__printf__,fmt_pos,arg_pos))) #else #define MONO_ATTR_FORMAT_PRINTF(fmt_pos,arg_pos) #endif @@ -84,7 +84,7 @@ typedef SSIZE_T ssize_t; #define MONO_PROFILER_API MONO_API #ifdef __GNUC__ -#define MONO_ALWAYS_INLINE __attribute__((always_inline)) +#define MONO_ALWAYS_INLINE __attribute__ ((__always_inline__)) #elif defined(_MSC_VER) #define MONO_ALWAYS_INLINE __forceinline #else @@ -92,7 +92,7 @@ typedef SSIZE_T ssize_t; #endif #ifdef __GNUC__ -#define MONO_NEVER_INLINE __attribute__((noinline)) +#define MONO_NEVER_INLINE __attribute__ ((__noinline__)) #elif defined(_MSC_VER) #define MONO_NEVER_INLINE __declspec(noinline) #else @@ -100,7 +100,7 @@ typedef SSIZE_T ssize_t; #endif #ifdef __GNUC__ -#define MONO_COLD __attribute__((cold)) +#define MONO_COLD __attribute__ ((__cold__)) #else #define MONO_COLD #endif diff --git a/mono/utils/mono-hwcap-s390x.c b/mono/utils/mono-hwcap-s390x.c index c578a620d92..93bd236ba75 100644 --- a/mono/utils/mono-hwcap-s390x.c +++ b/mono/utils/mono-hwcap-s390x.c @@ -114,7 +114,7 @@ typedef struct { uint8_t sccm:1; // 142 - Store CPU counter multiple uint8_t ibm13:1; // 143 - Assigned to IBM uint8_t x015[14]; // 144-256 Undefined -} __attribute__ ((packed)) __attribute__ ((aligned(8))) facilityList_t; +} __attribute__ ((__packed__)) __attribute__ ((__aligned__(8))) facilityList_t; void mono_hwcap_arch_init (void) diff --git a/mono/utils/mono-publib.h b/mono/utils/mono-publib.h index e2614388ce9..6b1e71a940a 100644 --- a/mono/utils/mono-publib.h +++ b/mono/utils/mono-publib.h @@ -45,7 +45,7 @@ typedef unsigned __int64 uint64_t; #include #ifdef __GNUC__ -#define MONO_API_EXPORT __attribute__ ((visibility ("default"))) +#define MONO_API_EXPORT __attribute__ ((__visibility__ ("default"))) #else #define MONO_API_EXPORT #endif @@ -105,9 +105,9 @@ mono_set_allocator_vtable (MonoAllocatorVTable* vtable); #if defined (MONO_INSIDE_RUNTIME) #if defined (__clang__) -#define MONO_RT_EXTERNAL_ONLY __attribute__ ((unavailable("The mono runtime must not call this function"))) +#define MONO_RT_EXTERNAL_ONLY __attribute__ ((__unavailable__ ("The mono runtime must not call this function"))) #elif defined (__GNUC__) -#define MONO_RT_EXTERNAL_ONLY __attribute__ ((error("The mono runtime must not call this function"))) +#define MONO_RT_EXTERNAL_ONLY __attribute__ ((__error__ ("The mono runtime must not call this function"))) #else #define MONO_RT_EXTERNAL_ONLY #endif /* __clang__ */ @@ -117,7 +117,7 @@ mono_set_allocator_vtable (MonoAllocatorVTable* vtable); #endif /* MONO_INSIDE_RUNTIME */ #ifdef __GNUC__ -#define _MONO_DEPRECATED __attribute__ ((deprecated)) +#define _MONO_DEPRECATED __attribute__ ((__deprecated__)) #elif defined (_MSC_VER) #define _MONO_DEPRECATED __declspec (deprecated) #else diff --git a/mono/utils/mono-signal-handler.h b/mono/utils/mono-signal-handler.h index 68fa0ad5f62..a90affdd91e 100644 --- a/mono/utils/mono-signal-handler.h +++ b/mono/utils/mono-signal-handler.h @@ -41,7 +41,7 @@ #ifdef KRAIT_IT_BUG_WORKAROUND #define MONO_SIGNAL_HANDLER_FUNC(access, name, arglist) \ static void __krait_ ## name arglist; \ - __attribute__ ((naked)) access void \ + __attribute__ ((__naked__)) access void \ name arglist \ { \ asm volatile ( \ @@ -52,7 +52,7 @@ "b __krait_" # name \ "\n\t"); \ } \ - static __attribute__((used)) void __krait_ ## name arglist + static __attribute__ ((__used__)) void __krait_ ## name arglist #endif /* Don't use this */ diff --git a/mono/utils/mono-tls.c b/mono/utils/mono-tls.c index da4498936a2..68b4ce36394 100644 --- a/mono/utils/mono-tls.c +++ b/mono/utils/mono-tls.c @@ -58,7 +58,7 @@ #if defined(PIC) #ifdef PIC_INITIAL_EXEC -#define MONO_TLS_FAST __attribute__((tls_model("initial-exec"))) +#define MONO_TLS_FAST __attribute__ ((__tls_model__("initial-exec"))) #else #if defined (__powerpc__) /* local dynamic requires a call to __tls_get_addr to look up the @@ -70,13 +70,13 @@ For now we will disable this. */ #define MONO_TLS_FAST #else -#define MONO_TLS_FAST __attribute__((tls_model("local-dynamic"))) +#define MONO_TLS_FAST __attribute__ ((__tls_model__("local-dynamic"))) #endif #endif #else -#define MONO_TLS_FAST __attribute__((tls_model("local-exec"))) +#define MONO_TLS_FAST __attribute__ ((__tls_model__("local-exec"))) #endif diff --git a/mono/utils/valgrind.h b/mono/utils/valgrind.h index a8b3ce55cce..343d301821e 100644 --- a/mono/utils/valgrind.h +++ b/mono/utils/valgrind.h @@ -6214,7 +6214,7 @@ typedef /* Modern GCC will optimize the static routine out if unused, and unused attribute will shut down warnings about it. */ static int VALGRIND_PRINTF(const char *format, ...) - __attribute__((format(__printf__, 1, 2), __unused__)); + __attribute__ ((__format__(__printf__, 1, 2), __unused__)); #endif static int #if defined(_MSC_VER) @@ -6252,7 +6252,7 @@ VALGRIND_PRINTF(const char *format, ...) #if defined(__GNUC__) || defined(__INTEL_COMPILER) && !defined(_MSC_VER) static int VALGRIND_PRINTF_BACKTRACE(const char *format, ...) - __attribute__((format(__printf__, 1, 2), __unused__)); + __attribute__ ((__format__(__printf__, 1, 2), __unused__)); #endif static int #if defined(_MSC_VER)