User`s guide

Pragmas for the DSP56800 and DSP56800E
Pragma Reference
387Targeting MC56F83xx/DSP5685x Controllers
gcc_extensions
Controls the acceptance of GNU C language extensions.
Prototype
#pragma gcc_extensions on | off | reset
Remarks
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.
Listing C.8
provides an example.
Listing C.8 Example of Array Initialization with a Non-const Value
int foo(int arg)
{
int arr[2] = { arg, arg+1 };
}
sizeof( void ) == 1
sizeof( function-type ) == 1
Limited support for GCC statements and declarations within expressions. Listing
C.9 provides an example.
Listing C.9 Example of GCC Statements and Declarations Within Expressions
#pragma gcc_extensions on
#define POW2(n) ({ int i,r; for(r=1,i=n; i>0; --i) r<<=1; r;})
int main()
{
return POW2(4);
}
This feature only works for expressions in function bodies.
Macro redefinitions without a previous #undef.
The GCC keyword typeof.