[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:2012 Rules applicable to message 0650:

Rule-1.1  (Required) The program shall contain no violations of the standard C syntax and constraints, and shall not exceed the implementation's translation limits


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