warningf(HERE, "traditional C rejects ISO C style function definition of function '%Y'",
ndeclaration->symbol);
}
+ if (warning.old_style_definition && type->function.unspecified_parameters) {
+ warningf(HERE, "old-style function definition '%Y'",
+ ndeclaration->symbol);
+ }
/* ยง 6.7.5.3 (14) a function definition with () means no
* parameters (and not unspecified parameters) */
.multichar = true,
.nested_externs = false,
.nonnull = true,
+ .old_style_definition = false,
.pointer_arith = true,
.redundant_decls = true,
.return_type = true,
OPT("multichar", multichar);
OPT("nested-externs", nested_externs);
OPT("nonnull", nonnull);
+ OPT("old-style-definition", old_style_definition);
OPT("pointer_arith", pointer_arith);
OPT("redundant-decls", redundant_decls);
OPT("return-type", return_type);
bool multichar:1; /**< Warn if a multicharacter constant ('FOOF') is used. */
bool nested_externs:1; /**< Warn if an 'extern' declaration is encountered within a function. */
bool nonnull:1; /**< Warn about passing a null pointer for arguments marked nonnull. */
-#if 0 // TODO
bool old_style_definition:1; /**< Warn if an old-style function definition is used. */
+#if 0 // TODO
bool packed:1; /**< Warn if a structure is given the packed attribute, but the packed attribute has no effect on the layout or size of the structure */
bool padded:1; /**< Warn if padding is included in a structure, either to align an element of the structure or to align the whole structure */
bool parentheses:1; /**< Warn if parentheses are omitted in certain contexts (assignment where truth value is expected, if-else-braces) */