Next: C++ Extensions, Previous: C Extensions, Up: Top [Contents][Index]
GCC provides a very large number of implicitly-declared built-in functions that are typically inlined by the compiler. Some of these builtins directly correspond to standard library routines. Some are for internal use in the processing of exceptions or variable-length argument lists and are not documented here because they may change from time to time; we do not recommend general use of these functions.
The remaining functions are provided either for optimization purposes, or to expose low-level functionality needed to implement features provided by library functions or similar “glue” between GCC and other programming languages or libraries. Others are target-specific, providing direct access to instructions that have no direct C equivalents without the need to write assembly language. There are also builtins to support various kinds of runtime error checking.
Most builtins have names prefixed with ‘__builtin_’, although not all of them use this convention. Except as otherwise documented, all built-in functions are available from any of the C family languages supported by GCC.
With the exception of built-ins that have library equivalents such as the standard C library functions discussed below in Library Builtins, or that expand to library calls, GCC built-in functions are always expanded inline and thus do not have corresponding entry points and their address cannot be obtained. Attempting to use them in an expression other than a function call results in a compile-time error.
| • Library Builtins: | Built-in equivalents for C library functions. | |
| • Numeric Builtins: | Additional builtins for numeric and bit operations. | |
| • Stack Allocation: | Built-in alloca variants. | |
| • Nonlocal Gotos: | Built-ins for nonlocal gotos. | |
| • Constructing Calls: | Built-ins for dispatching a call to another function. | |
| • Return Address: | Getting the return or frame address of a function. | |
| • Stack Scrubbing: | Stack scrubbing internal interfaces. | |
| • Vector Extensions: | Using vector instructions through built-in functions. | |
| • Atomic Memory Access: | __atomic and __sync builtins. | |
| • Object Size Checking: | Built-in functions for limited buffer overflow checking. | |
| • New/Delete Builtins: | Built-in functions for C++ allocations and deallocations. | |
| • Other Builtins: | Other built-in functions. | |
| • Target Builtins: | Built-in functions specific to particular targets. |
Next: C++ Extensions, Previous: C Extensions, Up: Top [Contents][Index]