![]() |
|
MISRA-C:2004 Rule 8.7: (Required) |
|
||||
![]() | |||||||
Example Code:
#include "misra.h"
#include "m2cmex.h"
static S16 s0807a; /* MISRA Violation - Only referenced in function test_0807a */
static S16 s0807b; /* MISRA Violation - Only referenced in function test_0807b */
extern S16 obj_0807c = 0; /* MISRA Violation - Only referenced in function test_0807b */
extern S16 test_0807a( void )
{
s0807a += s16a;
return s0807a;
}
extern S16 test_0807b( void )
{
s0807b = s16b;
obj_0807c = s16a;
return s0807b + obj_0807c;
}
QAC messages that encompass this guideline:
| 1514 | The object '%1s' is only referenced by function '%2s', in the translation unit where it is defined |
| 3218 | File scope static, '%s', is only accessed in one function. |
|
||
(c) The Motor Industry Research Association, 2004
|
QA C Source Code Analyser 8.1.2
MISRA-C:2004 Compliance Module 3.2 © 2013 Programming Research www.programmingresearch.com |
Personality Groups | Glossary | Message Index | MISRA-C:2004 Rule Index | Contents |