![]() |
|
MISRA-C:2004 Rule 20.2: (Required) |
|
||||
![]() | |||||||
Example Code:
/* PRQA S 2983,2984,3203 ++ */
#include "misra.h"
#include "m2cmex.h"
static F32 sqrt( F32 d ); /* MISRA Violation */
static S16 _test_2002a( void ); /* MISRA Violation */
enum { EOF = -1 }; /* MISRA Violation */
enum { cos = 55 }; /* MISRA Violation */
enum tm { t1, t2, t3 }; /* MISRA Violation */
typedef int FILE; /* MISRA Violation */
typedef signed int sin; /* MISRA Violation */
extern S16 test_2002( void )
{
F32 f;
FILE r;
sin s = 5;
f = sqrt( 1.44F );
r = _test_2002a();
r = r + s;
return r;
}
static F32 sqrt( F32 d ) /* MISRA Violation */
{
return( d );
}
static S16 _test_2002a( void ) /* MISRA Violation */
{
return 1;
}
QAC messages that encompass this guideline:
| 0602 | [U] The identifier '%s' is reserved for use by the library. |
| 4602 | The identifier '%1s' is declared as a macro in '<%2s>'. |
| 4603 | The object/function '%1s'is being defined with the same name as an ordinary identifier defined in '<%2s>'. |
| 4604 | The object/function '%1s' is being declared with the same name as an ordinary identifier defined in '<%2s>'. |
| 4605 | The typedef '%1s' is also defined in '<%2s>'. |
| 4606 | The typedef '%1s' has the same name as another ordinary identifier in '<%2s>'. |
| 4607 | The enum constant '%1s' has the same name as another ordinary identifier in '<%2s>'. |
| 4608 | The tag '%1s' is also defined in '<%2s>'. |
Related rules:
| Rule 1.2 | No reliance shall be placed on undefined or unspecified behaviour. |
|
||
(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 |