2.3.12. Controlling error messages

The compiler issues errors to indicate serious problems in the code it is attempting to compile. The compiler options described below enable you to:


These options force the compiler to accept C and C++ source that normally produces errors. If you use any of these options to ignore error messages, it means that your source code does not conform to the appropriate C or C++ standard.

These options can be useful during development, or when importing source code from other environments. However, they might permit code to be produced that does not function correctly. It is generally better to correct the source than to use options to switch off error messages.

The general form of the -E compiler option is:


where options is a set of one or more of the letters a, c, f, i, l, p, or z as described below.

If the + character is included in the characters following the -E, the error messages corresponding to any following letters are enabled rather than suppressed.


The -E option on its own without any options is the preprocessor switch. See Setting preprocessor options.

You can specify multiple options. For example:


turns off the error messages specified by a and c.

The following options are on by default:


For C++ only, this option downgrades access control errors to warnings. For example:

class A { void f() {}; };							// private member
A a;
void g() { a.f(); } 							// erroneous access

C3032E: ’A::f’ is a non-public member


This option suppresses all implicit cast errors, such as implicit casts of a nonzero int to pointer.

C3029E: ’=’: implicit cast of non-0 int to pointer


This option suppresses errors for unclean casts, such as short to pointer.


For C++ only, this option downgrades from error to warning the use of implicit int in constructs such as const i;.

C2225W: declaration lacks type/storage-class (assuming 'int'): 'i'

This option suppresses errors about linkage disagreements where functions are implicitly declared as extern and then later redeclared as static.

C2991E: linkage disagreement for ’f’ - treated as ’extern’


This option suppresses errors arising as the result of extra characters at the end of a preprocessor line.


This option suppresses the errors caused by zero-length arrays.

C3017E: size of a [] array required, treated as [1]

Copyright © 1999-2001 ARM Limited. All rights reserved.ARM DUI 0067D