Declaring Attributes of Functions
copy from gcc manual
In GNU C, you declare certain things about functions called in your program which help
the compiler optimize function calls and check your code more carefully.
The keyword __attribute__ allows you to specify special attributes when making a
declaration. This keyword is followed by an attribute specification inside double parentheses.
The following attributes are currently defined for functions on all targets: aligned, alloc_
size, noreturn, returns_twice, noinline, noclone, always_inline, flatten, pure,
const, nothrow, sentinel, format, format_arg, no_instrument_function, no_split_
stack, section, constructor, destructor, used, unused, deprecated, weak, malloc,
alias, ifunc, warn_unused_result, nonnull, gnu_inline, externally_visible, hot,
cold, artificial, error and warning. Several other attributes are defined for functions on
particular target systems. Other attributes, including section are supported for variables
declarations (see Section 6.36 [Variable Attributes], page 341) and for types (see Section 6.37
[Type Attributes], page 350).
GCC plugins may provide their own attributes.
You may also specify attributes with ‘__’ preceding and following each keyword. This
allows you to use them in header files without being concerned about a possible macro of
the same name. For example, you may use __noreturn__ instead of noreturn.
See Section 6.31 [Attribute Syntax], page 337, for details of the exact syntax for using
attributes.
相關文章
- object is not an instance of declaring classObject
- functionsFunction
- Database Triggers and event attributes--Event AttributesDatabase
- jQuery attributes(上)jQuery
- Oracle WMSYS FunctionsOracleFunction
- Refactoring to FunctionsFunction
- C_functionsFunction
- Expression Date FunctionsExpressFunction
- Oracle Date FunctionsOracleFunction
- Database Triggers and event attributes--Event Attributes【Blog 搬家】Database
- Oracle ASM Attributes DirectoryOracleASM
- HTML 23 - Form AttributesHTMLORM
- HTML 25 - Input AttributesHTML
- Analytic Functions in OracleFunctionOracle
- SQL Server LEFT FunctionsSQLServerFunction
- TypeScript 之 More on FunctionsTypeScriptFunction
- MySql Date/Time FunctionsMySqlFunction
- PHPExecuteCommandBypassDisable_functionsPHPFunction
- Hive FUNCTIONS函式HiveFunction函式
- 指南:函式(Functions)函式Function
- Pipelined FunctionsFunction
- Unity Attributes 自帶特性Unity
- Oracle ASM Disk Group AttributesOracleASM
- Playing with __attributes__ (三)
- Playing with __attributes__ (二)
- graphite custom functionsFunction
- SQL Server SUBSTRING FunctionsSQLServerFunction
- Swift-函式(Functions)Swift函式Function
- (轉)jQuery String FunctionsjQueryFunction
- Procedure for Setting Partner FunctionsFunction
- DETERMINISTIC Functions (203)Function
- C#中Attributes的用法C#
- Standard Functions Used in SAP Retail with ArticlesFunctionAI
- Redis Functions 介紹之一RedisFunction
- Redis Functions 介紹之二RedisFunction
- Day6 函式(Functions)函式Function
- Oracle Pipelined Table FunctionsOracleFunction
- [Reactive] Run functions when data changesReactFunction