Keil Logo Arm Logo

Technical Support

On-Line Manuals

Compiler Reference Guide

Conventions and Feedback Introduction Compiler Command-line Options Language Extensions Preprocessor extensions #assert #include_next #unassert #warning C99 language features available in C90 // comments Subscripting struct Flexible array members C99 language features available in C++ and C90 Variadic macros long long restrict Hexadecimal floats Standard C language extensions Constant expressions Array and pointer extensions Block scope function declarations Dollar signs in identifiers Top-level declarations Benign redeclarations External entities Function prototypes Standard C++ language extensions ? operator Declaration of a class member friend Read/write constants Scalar type constants Specialization of nonmember function templates Type conversions Standard C and Standard C++ language extensions Address of a register variable Arguments to functions Anonymous classes, structures and unions Assembler labels Empty declaration Hexadecimal floating-point constants Incomplete enums Integral type extensions Label definitions Long float Nonstatic local variables Structure, union, enum, and bitfield extensions Compiler-specific Features C and C++ Implementation Details Semihosting ARMv6 SIMD Instruction Intrinsics Via File Syntax Standard C Implementation Definition Standard C++ Implementation Definition C and C++ Compiler Implementation Limits

Array and pointer extensions

Array and pointer extensions

The following array and pointer extensions are supported:

  • Assignment and pointer differences are permitted between pointers to types that are interchangeable but not identical, for example, unsigned char * and char *. This includes pointers to same-sized integral types, typically, int * and long *. A warning is issued.

    Assignment of a string constant to a pointer to any kind of character is permitted without a warning.

  • Assignment of pointer types is permitted in cases where the destination type has added type qualifiers that are not at the top level, for example, assigning int ** to const int **. Comparisons and pointer difference of such pairs of pointer types are also permitted. A warning is issued.

  • In operations on pointers, a pointer to void is always implicitly converted to another type if necessary. Also, a null pointer constant is always implicitly converted to a null pointer of the right type if necessary. In ISO C, some operators permit these, and others do not.

  • Pointers to different function types can be assigned or compared for equality (==) or inequality (!=) without an explicit type cast. A warning or error is issued.

    This extension is prohibited in C++ mode.

  • A pointer to void can be implicitly converted to, or from, a pointer to a function type.

  • In an initializer, a pointer constant value can be cast to an integral type if the integral type is big enough to contain it.

  • A non lvalue array expression is converted to a pointer to the first element of the array when it is subscripted or similarly used.

Copyright © 2007-2008, 2011-2012 ARM. All rights reserved.ARM DUI 0376D
Non-ConfidentialID062912

Keil logo

Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.