Controls the acceptance of GNU C language extensions.
#pragma gcc_extensions on | off | reset
If you enable this pragma, the compiler accepts GNU C extensions in C source code. This includes the following non-ANSI C extensions:
- Initialization of automatic
struct or
array variables with non-
const values.
- Illegal pointer conversions
- sizeof( void ) == 1
- sizeof( function-type ) == 1
- Limited support for GCC statements and declarations within expressions.
- Macro redefinitions without a previous
#undef .
- The GCC keyword
typeof
- Function pointer arithmetic supported
- void* arithmetic supported
- Void expressions in return statements of void
- __builtin_constant_p (expr) supported
- Forward declarations of arrays of incomplete type
- Forward declarations of empty static arrays
- Pre-C99 designated initializer syntax (deprecated)
- shortened conditional expression (
c ?: y )
- long __builtin_expect (long exp, long c) now accepted
By default, this pragma is disabled.