![]() |
![]() |
0618 | ![]() |
||||
![]() | |||||||
| ISO C99 Language features | REFERENCE - ISO:C90-6.5.3 Type Qualifiers, ISO:C99-6.7.3 Type Qualifiers | ||||||
This is a constraint error in ISO:C90 but is permitted in ISO:C99. A redundant 'volatile' type qualifier has been used in this declaration. Notice that the syntax of the C language allows a type qualifier to be located either before or after a type specifier, but to include it twice is unnecessary and confusing. For example:
/*PRQA S 553,1305,3210,3211,3408,3447,3448,3602 ++*/
extern volatile int v1;
extern int volatile v2;
extern volatile volatile int v3; /* Message 0618 - second volatile is redundant */
extern volatile int volatile v4; /* Message 0618 - second volatile is redundant */
extern int volatile volatile v5; /* Message 0618 - second volatile is redundant */
extern volatile int * p1; /* - pointer to volatile int */
extern int volatile * p2; /* - pointer to volatile int */
extern int * volatile p3; /* - volatile pointer to int */
extern volatile int * volatile p4; /* - volatile pointer to volatile int */
extern int volatile * volatile p5; /* - volatile pointer to volatile int */
extern volatile int volatile * p6; /* Message 0618 - second volatile is redundant */
extern volatile int volatile * volatile p7; /* Message 0618 - second volatile is redundant */
typedef volatile int T1;
extern volatile T1 x1; /* Message 0618 - volatile is redundant */
MISRA-C:2004 Rules applicable to message 0618:
| Rule 1.1 (Required) | All code shall conform to ISO/IEC 9899:1990 C programming language, ISO 9899, amended and corrected by ISO/IEC 9899/COR1:1995, ISO/IEC 9899/AMD1:1995, and ISO/IEC 9899/COR2: 1996192 |
See also:
![]() | ||
| QA·C Source Code Analyser 8.1
MISRA-C:2004 Compliance Module 3.2 © 2012 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | MISRA-C:2004 Rule Index | Contents |