SPRUIG8J January 2018 – March 2024
Most of the GCC language extensions are available in the TI compiler when compiling in relaxed ANSI mode (--relaxed_ansi).
The extensions that the TI compiler supports are listed in Table 5-6, which is based on the list of extensions found at the GNU web site. The shaded rows describe extensions that are not supported.
Extensions | Descriptions |
---|---|
Statement expressions | Putting statements and declarations inside expressions (useful for creating smart 'safe' macros) |
Local labels | Labels local to a statement expression |
Labels as values | 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 |
Naming types(1) | Giving a name to the type of an expression |
typeof operator | typeof referring to the type of an expression |
Generalized lvalues | Using question mark (?) and comma (,) and casts in lvalues |
Conditionals | Omitting the middle operand of a ?: expression |
long long | Double long word integers and long long int type |
Hex floats | Hexadecimal floating-point constants |
Complex | Data types for complex number |
Zero length | Zero-length arrays |
Variadic macros | Macros with a variable number of arguments |
Variable length | Arrays whose length is computed at run time |
Empty structures | Structures with no members |
Subscripting | Any array can be subscripted, even if it is not an lvalue. |
Escaped newlines | Slightly looser rules for escaped newlines |
Multi-line strings(1) | String literals with embedded newlines |
Pointer arithmetic | Arithmetic on void pointers and function pointers |
Initializers | Non-constant initializers |
Compound literals | Compound literals give structures, unions, or arrays as values |
Designated initializers | 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 | A dollar sign is allowed in identifiers. |
Character escapes | The character ESC is represented as \e |
Variable attributes | Specifying the attributes of variables |
Type attributes | Specifying the attributes of types |
Alignment | Inquiring about the alignment of a type or variable |
Inline | Defining inline functions (as fast as macros) |
Assembly labels | Specifying the assembler name to use for a C symbol |
Extended asm | Assembler instructions with C operands |
Constraints | Constraints for asm operands |
Wrapper headers | Wrapper header files can include another version of the header file using #include_next |
Alternate keywords | Header files can use __const__ etc |
Explicit reg vars | Defining variables residing in specified registers |
Incomplete enum types | Define an enum tag without specifying its possible values |
Function names | Printable strings which are the name of the current function |
Return address | Getting the return or frame address of a function (limited support) |
Other built-ins | Other built-in functions (see Section 5.13.6) |
Vector extensions | Using vector operations (see Section 5.14) |
Target built-ins | Built-in functions 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. |