3.2.1. C language extensions

The compilers support the ANSI C language extensions described below and in C and C++ language extensions. The extensions are not available if the compiler is restricted to compiling strict ANSI C, for example, by specifying the -strict compiler option.

// comments

The character sequence // starts a comment. As in C++, the comment is terminated by the next newline character.

Note

Comment removal takes place after line continuation, so:

// this is a - \
single comment

The characters of a comment are examined only to find the comment terminator, therefore:

  • // has no special significance inside a comment introduced by /*

  • /* has no special significance inside a comment introduced by //

constant expressions

Extended constant expressions, such as the following, are allowed in initializers:

int i;
int j = (int)&i; /* but not allowed by ANSI/ISO */
Copyright © 1999-2001 ARM Limited. All rights reserved.ARM DUI 0067D
Non-Confidential