Rule A3-1-4 (required, design / implementation, automated)

When an array with external linkage is declared, its size shall be stated explicitly.

Rationale

Although it is possible to declare an array of incomplete type and access its elements, it is safer to do so when the size of the array can be explicitly determined.

Example

//% $Id: A3-1-4.hpp 271687 2017-03-23 08:57:35Z piotr.tanski $
#include <cstdint>
extern std::int32_t array1[]; // Non-compliant
extern std::int32_t array2[42]; // Compliant

See also

MISRA C++ 2008 [7]: Rule 3-1-3 When an array is declared, its size shall either be stated explicitly or defined implicitly by initialization.