zeroExtentArrays Language Option (C++)

Syntax: Default:
lang(zeroExtentArrays[, yes])
lang(zeroExtentArrays, no)
lang(zeroExtentArrays[, yes])

This option controls whether zero-extent arrays are allowed as the last non-static data member in a class definition.

By default, VisualAge C++ allows arrays with zero elements. This is an extension to the C++ standard, and provides compatibility with Microsoft Visual C++. The example declarations below define dimensionless arrays a and b.

struct S1 { char a[0]; };
struct S2 { char b[]; };

Set zeroExtentArrays to no for compliance with standard C++ or with the ANSI language level supported by previous versions of VisualAge C++ and predecessor products.

When this option is set to yes, you receive warnings about zero-extent arrays in your code, unless you suppress the message with report(disable, "CPPC1607").



Incremental C++ Build
Configuration Files


Set Build Options
Build


Language Options for C++
Build Options
Build Options for Compliance With the C++ Standard
Build Options for Compatibility with Old C++ Compilers