Oracle® Solaris Studio 12.4: C User's Guide

Exit Print View

Updated: March 2015
 
 

2.9 Supported Attributes

The compiler implements the following attributes (__attribute__ ((keyword)) ) for compatibility. Spelling the attribute keyword within double underscores, __keyword__, is also accepted.

alias

Makes a name an alias for a declared function or variable name

aligned

Roughly equivalent to #pragma align. Generates a warning and is ignored if used on variable length arrays.

always_inline

Equivalent to #pragma inline and -xinline

const

Equivalent to #pragma no_side_effect

constructor

Equivalent to #pragma init

deprecated(msg)

Results in a warning if the variable or function is used anywhere in the source file. The optional argument msg must be a string and will be included in the warning message if issued.

destructor

Equivalent to #pragma fini

malloc

Equivalent to #pragma returns_new_memory

noinline

Equivalent to #pragma no_inline and -xinline

noreturn

Equivalent to #pragma does_not_return

pure

Equivalent to #pragma does_not_write_global_data

packed

Equivalent to #pragma pack()

returns_twice

Equivalent to #pragma unknown_control_flow

vector_size

Indicates that a variable or a type name (created using typedef) represents a vector.

visibility

Provides linker scoping as described in Linker Scoping Specifiers. Syntax is: __attribute__((visibility(“visibility-type”))), where visibility-type is one of:

default

Same as __global linker scoping

hidden

Same as __hidden linker scoping

internal

Same as __symbolic linker scoping

weak

Equivalent to #pragma weak