13.07.2015 Views

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

C++ Languageenum E { e, };2.3. GNU ExtensionsThe C++ compiler can be configured to support the GNU C++ mode (command line option --g++). In thismode, many extensions provided by the GNU C++ compiler are accepted. The following extensions areprovided in GNU C++ mode.• Attributes, introduced by the keyword __attribute__, can be used on declarations of variables,functions, types, and fields. The alias, aligned, alloc_size, always_inline, artificial,common, const, constructor, deprecated, destructor, error, externally_visible,flatten, <strong>for</strong>mat, <strong>for</strong>mat_arg, gnu_inline, hot, init_priority, malloc, mode,no_check_memory_usage, no_instrument_function, nocommon, noinline, nonnull,noreturn, nothrow, packed, pure, section, sentinel, strong, unused, used, volatile,warn_unused_result, warning, weak, and weakref attributes are supported.• Extended designators are accepted• Compound literals are accepted.• Non-standard anonymous unions are accepted• The typeof operator is supported. This operator can take an expression or a type (like the sizeofoperator, but parentheses are always required) and expands to the type of the given entity. It can beused wherever a typedef name is allowedtypeof(2*2.3) d; // Declares a "double"typeof(int) i; // Declares an "int"This can be useful in macro and template definitions.• The __extension__ keyword is accepted preceding declarations and certain expressions. It has noeffect on the meaning of a program.__extension__ __inline__ int f(int a) {return a > 0 ? a/2 : f(__extension__ 1-a);}• In all GNU C modes and in GNU C++ modes with gnu_version < 30400, the type modifiers signed,unsigned, long and short can be used with typedef types if the specifier is valid with the underlyingtype of the typedef in ANSI C. E.g.:typedef int I;unsigned I *pui; // OK in GNU C++ mode;// same as "unsigned int *pui"• If the command line option --long-long is specified, the extensions <strong>for</strong> the long long and unsignedlong long types are enabled.47

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!