GNUC扩展语法

本文章的内容是摘录自GNUC手册。

http://gcc.gnu.org/onlinedocs/gcc-4.5.1/gcc/C-Extensions.html#C-Extensions

在我从事的工作中,总使用到GNUC的语法知识,同志们,总是在这样的语法前头痛不已,我总结以下内容为了帮助大家了解GNUC语法知识。

* Statement Exprs: Putting statements and declarations inside expressions.
* Local Labels: Labels local to a block.
* Labels as Values: Getting pointers to labels, and computed gotos.
* Nested Functions: As in Algol and Pascal, lexical scoping of functions.
* Constructing Calls: Dispatching a call to another function.
* Typeof: typeof: referring to the type of an expression.
* Conditionals: Omitting the middle operand of a `?:' expression.
* Long Long: Double-word integers---long long int.
* Complex: Data types for complex numbers.
* Floating Types: Additional Floating Types.
* Half-Precision: Half-Precision Floating Point.
* Decimal Float: Decimal Floating Types.
* Hex Floats: Hexadecimal floating-point constants.
* Fixed-Point: Fixed-Point Types.
* Named Address Spaces: Named address spaces.
* Zero Length: Zero-length arrays.
* Variable Length: Arrays whose length is computed at run time.
* Empty Structures: Structures with no members.
* Variadic Macros: Macros with a variable number of arguments.
* Escaped Newlines: Slightly looser rules for escaped newlines.
* Subscripting: Any array can be subscripted, even if not an lvalue.
* Pointer Arith: Arithmetic on void-pointers and function pointers.
* Initializers: Non-constant initializers.
* Compound Literals: Compound literals give structures, unions or arrays as values.
* Designated Inits: Labeling elements of initializers.
* Cast to Union: Casting to union type from any member of the union.
* Case Ranges: `case 1 ... 9' and such.
* Mixed Declarations: Mixing declarations and code.
* Function Attributes: Declaring that functions have no side effects, or that they can never return.
* Attribute Syntax: Formal syntax for attributes.
* Function Prototypes: Prototype declarations and old-style definitions.
* C++ Comments: C++ comments are recognized.
* Dollar Signs: Dollar sign is allowed in identifiers.
* Character Escapes: `\e' stands for the character <ESC>.
* Variable Attributes: Specifying attributes of variables.
* Type Attributes: Specifying attributes of types.
* Alignment: Inquiring about the alignment of a type or variable.
* Inline: Defining inline functions (as fast as macros).
* Extended Asm: Assembler instructions with C expressions as operands. (With them you can define ``built-in'' functions.)
* Constraints: Constraints for asm operands
* Asm Labels: Specifying the assembler name to use for a C symbol.
* Explicit Reg Vars: Defining variables residing in specified registers.
* Alternate Keywords: __const__, __asm__, etc., for header files.
* Incomplete Enums: enum foo;, with details to follow.
* Function Names: Printable strings which are the name of the current function.
* Return Address: Getting the return or frame address of a function.
* Vector Extensions: Using vector instructions through built-in functions.
* Offsetof: Special syntax for implementing offsetof.
* Atomic Builtins: Built-in functions for atomic memory access.
* Object Size Checking: Built-in functions for limited buffer overflow checking.
* Other Builtins: Other built-in functions.
* Target Builtins: Built-in functions specific to particular targets.
* Target Format Checks: Format checks specific to particular targets.
* Pragmas: Pragmas accepted by GCC.
* Unnamed Fields: Unnamed struct/union fields within structs/unions.
* Thread-Local: Per-thread variables.

* Binary constants: Binary constants using the `0b' prefix.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值