[previous] 0654 [next] [U] Using 'const' or 'volatile' in a function return type is undefined.
Explicitly undefined REFERENCE - ISO:C90-6.5.3 Type Qualifiers - Semantics

A function has been declared as returning a qualified type.

Only an expression that is an lvalue can have a qualified type.

For example:


/*PRQA S 553,2017,3210,3447,3602 ++*/

extern const int f1(void);                      /* Message 0654 */

extern volatile int f2(void);                   /* Message 0654 */

extern const int * f3(void);                    /* OK           */

extern volatile int * f4(void);                 /* OK           */


MISRA-C:2004 Rules applicable to message 0654:

Rule  1.2  (Required) No reliance shall be placed on undefined or unspecified behaviour.


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