[previous] 0650 [next] [C] Illegal storage class specifier on named function parameter.
Constraint violations REFERENCE - ISO:C90-6.5.4.3 Function Declarators - Constraints, ISO:C90-6.7.1 Function Definitions - Constraints

This is a constraint error

A storage-class specifier other than 'register' has been applied to a named function parameter. Parameters are local objects, initialised on entry to the function at each call. They are automatic but the 'auto' storage class specifier may not be used.

For example:


/*PRQA S 553,2213,1335,2711,3206,3210,3408 ++*/

void f1(typedef  int );       /* Message 0655 */
void f2(extern   int );       /* Message 0655 */
void f3(static   int );       /* Message 0655 */
void f4(auto     int );       /* Message 0655 */
void f5(register int );       /* OK */

void fa(typedef  int x);      /* Message 0650 */
void fb(extern   int x);      /* Message 0650 */
void fc(static   int x);      /* Message 0650 */
void fd(auto     int x);      /* Message 0650 */
void fe(register int x);      /* OK */


MISRA-C:2004 Rules applicable to message 0650:

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