[previous] 0747 [next] [C] 'return exp;' found in '%s()' whose return type is qualified 'void'.
Constraint violations REFERENCE - ISO:C90-6.6.6.4 The return Statement - Constraints

This is a constraint error

This return expression appears in a function with a qualified void return type. This is not allowed.

For example:


/*PRQA S 553,2017,3219,3227,3408,3602 ++*/

extern const void foo1(int n)
{                                  /* Message 0654 */
  return n;                        /* Message 0747 */
}

extern void foo2(int n)
{
  return n;                        /* Message 0746 */
}


MISRA C:2012 Rules applicable to message 0747:

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