[previous] 1012 [next] [E] Use of a C++ reference type ('type &') will be treated as a language extension.
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:2012 Rules applicable to message 1012:

Rule-1.2  (Advisory) Language extensions should not be used


See also:

QA·C Source Code Analyser 8.1
MISRA C:2012 Compliance Module 1.0
© 2012 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index Contents