[previous] 0604 [next] [C99] Declaration appears after statements in a compound statement.
ISO C99 Language features REFERENCE - ISO:C90-6.6.2 Compound Statement, or Block - Syntax

A declaration has been encountered in the middle of some executable statements. This syntax is not permitted in ISO:C90 but is allowed in ISO:C99. In C90, all declarations within a block must be located at the start of the block and before any executable statements.

For example:


/*PRQA S 2017,2211,3121,3199,3203,3408 ++*/

extern void foo(void)
{
  int i;

  i = 1;

  float f;                /* Message 0604 */

  f = 2.5F;

}

QA·C Source Code Analyser 8.1.2
© 2013 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index Contents