![]() |
|
MISRA C:2012 Rule-18.5: (Advisory) |
|
||||
![]() | |||||||
Amplification:
No more than two pointer declarators should be applied consecutively to a type. Any typedef-name appearing in a declaration is treated as if it were replaced by the type that it denotes.
Example Code:
#pragma PRQA_MESSAGES_OFF 2983
#include "misra.h"
#include "m3cmex.h"
typedef PC * CHARSTAR;
typedef uint16_t *** PPPU; /* 3260 */
static int16_t rule_1805a( PC ** const ptr[] ); /* 3262 */
extern int16_t rule_1805( void )
{
int16_t r;
PC tab[ 4 ];
PC *ptr1;
PC **ptr2;
PC ***ptr3; /* 3262 */
CHARSTAR **ptr4; /* 3262 */
CHARSTAR *const * const ptr5; /* 3262 */
ptr1 = &tab[ 0 ];
ptr2 = &ptr1;
ptr3 = &ptr2;
r = rule_1805a( ptr3 );
return r;
}
static int16_t rule_1805a( PC ** const ptr[] ) /* 3262 */
{
PC cx;
cx = ***ptr;
return 0;
}
QAC messages that encompass this guideline:
| 3260 | Typedef defined with more than 2 levels of indirection. |
| 3261 | Member of struct/union defined with more than 2 levels of indirection. |
| 3262 | Object defined or declared with more than 2 levels of indirection. |
| 3263 | Function defined or declared with a return type which has more than 2 levels of indirection. |
|
||
(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 |