[previous] MISRA C:2012  Rule-8.11:  (Advisory) [next] When an array with external linkage is declared, its size should be explicitly specified

Amplification:

This rule applies to non-defining declarations only. It is possible to define an array and specify its size implicitly by means of initialization.

Example Code:


#pragma PRQA_MESSAGES_OFF 3408,3447

#include "misra.h"
#include "m3cmex.h"

       int16_t arr1[12];
       int16_t arr2[  ] = { 1, 2, 3 };

extern int16_t arr3[12];
extern int16_t arr4[  ];                   /* 3684 */

extern int16_t rule_0811( void )
{
   return 0;
}


QAC messages that encompass this guideline:

3684 Array declared with unknown size.



(c) The Motor Industry Research Association, 2012
QA C Source Code Analyser 8.1.2
MISRA C:2012 Compliance Module 1.0
© 2013 Programming Research
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index Contents