bool emit (rich_location *rich_loc) final override
{
auto_diagnostic_group d;
+ diagnostic_metadata m;
+ /* "CWE-686: Function Call With Incorrect Argument Type". */
+ m.add_cwe (686);
bool warned
- = warning_at (rich_loc, get_controlling_option (),
- "%<va_arg%> expected %qT but received %qT"
- " for variadic argument %i of %qE",
- m_expected_type, m_actual_type,
- get_variadic_index_for_diagnostic (), m_va_list_tree);
+ = warning_meta (rich_loc, m, get_controlling_option (),
+ "%<va_arg%> expected %qT but received %qT"
+ " for variadic argument %i of %qE",
+ m_expected_type, m_actual_type,
+ get_variadic_index_for_diagnostic (), m_va_list_tree);
return warned;
}
__builtin_va_list ap;
__builtin_va_start (ap, placeholder);
- i = __builtin_va_arg (ap, int); /* { dg-warning "'va_arg' expected 'int' but received '\[^\n\r\]*' for variadic argument 1 of 'ap'" } */
+ i = __builtin_va_arg (ap, int); /* { dg-warning "'va_arg' expected 'int' but received '\[^\n\r\]*' for variadic argument 1 of 'ap' \\\[CWE-686\\\]" } */
__builtin_va_end (ap);
}