[previous] 1046 [next] [E] Function is being declared with default argument syntax. This is a language extension.
Language extensions

Default arguments are a C++ specific feature, which is provided as an extension to ISO:C Standard by some compilers.

QA·C will accept a constant expression or an object identifier as a default argument for a parameter, and use that argument whenever one is not provided explicitly in a function call.

This message will be issued for a declaration (but not a definition) of a function with default argument syntax.

For example:


/* PRQA S 1-9999 ++ */
/* PRQA S 1046 -- */

extern int f1 (int = 1, char = 0);         /* Message 1046 */

extern int gi;
extern int f2 (int = gi);                  /* Message 1046 */

extern int f3 (int a, char b = 0);         /* Message 1046 */

extern int f1 (int a = 1, char b = 0);     /* Message 1046 */

int f1 (int a = 11, char b = 10)           /* No message */
{
  return a + b + f2 () + f2 (0) + f3 (0);
}

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