![]() |
![]() |
1012 | ![]() |
||||
![]() | |||||||
| Language extensions | |||||||
C++ 'reference' declarations (declarations containing
&) are not valid in ISO:C but because the "-ex C++" option is enabled, this syntax is being parsed as a language extension.
If the language extension option were not enabled, message 1013 (a syntax error) would be generated instead.
For example:
/*PRQA S 553,2211,3199,3203,3205,3227,3408 ++*/
/************************/
/* OPTIONS: -ex C++ */
/************************/
int foo(int *a);
void func1(int &a) /* Message 1012 */
{
int &b = a; /* Message 1012 */
int *c = &a;
int r;
r = foo(&a);
}
MISRA-C:2004 Rules applicable to message 1012:
| 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 |