PR translation/90156 - add linter check suggesting to replace %<%s%> with %qs

gcc/c-family/ChangeLog:

	PR translation/90156
	* c-format.c (function_format_info::format_type): Adjust type.
	(function_format_info::is_raw): New member.
	(decode_format_type): Adjust signature.  Handle "raw" diag attributes.
	(decode_format_attr): Adjust call to decode_format_type.
	Avoid a redundant call to convert_format_name_to_system_name.
	Avoid abbreviating the word "arguments" in a diagnostic.
	(format_warning_substr): New function.
	(avoid_dollar_number): Quote dollar sign in a diagnostic.
	(finish_dollar_format_checking): Same.
	(check_format_info): Same.
	(struct baltoks_t): New.
	(c_opers, c_keywords, cxx_keywords, badwords, contrs): New arrays.
	(maybe_diag_unbalanced_tokens, check_tokens, check_plain): New
	functions.
	(check_format_info_main): Call check_plain.  Use baltoks_t.  Call
	maybe_diag_unbalanced_tokens.
	(handle_format_attribute): Spell out the word "arguments" in
	a diagnostic.

gcc/testsuite/ChangeLog:

	PR translation/90156
	* gcc.dg/format/gcc_diag-11.c: Enable.

From-SVN: r272483
This commit is contained in:
Martin Sebor 2019-06-19 19:08:24 +00:00 committed by Martin Sebor
parent ef3e6aa320
commit a04c0734e3
4 changed files with 1044 additions and 37 deletions

View File

@ -1,3 +1,25 @@
2019-06-19 Martin Sebor <msebor@redhat.com>
PR translation/90156
* c-format.c (function_format_info::format_type): Adjust type.
(function_format_info::is_raw): New member.
(decode_format_type): Adjust signature. Handle "raw" diag attributes.
(decode_format_attr): Adjust call to decode_format_type.
Avoid a redundant call to convert_format_name_to_system_name.
Avoid abbreviating the word "arguments" in a diagnostic.
(format_warning_substr): New function.
(avoid_dollar_number): Quote dollar sign in a diagnostic.
(finish_dollar_format_checking): Same.
(check_format_info): Same.
(struct baltoks_t): New.
(c_opers, c_keywords, cxx_keywords, badwords, contrs): New arrays.
(maybe_diag_unbalanced_tokens, check_tokens, check_plain): New
functions.
(check_format_info_main): Call check_plain. Use baltoks_t. Call
maybe_diag_unbalanced_tokens.
(handle_format_attribute): Spell out the word "arguments" in
a diagnostic.
2019-06-11 Matthew Beliveau <mbelivea@redhat.com>
PR c++/90449 - add -Winaccessible-base option.

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,8 @@
2019-06-19 Martin Sebor <msebor@redhat.com>
PR translation/90156
* gcc.dg/format/gcc_diag-11.c: Enable.
2019-06-19 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/69499

View File

@ -1,8 +1,7 @@
/* Test warnings for common punctuation, quoting, and spelling issues
in GCC diagnostics.
{ dg-do compile }
{ dg-options "-Wformat -Wformat-diag" }
{ dg-skip-if "-Wformat-diag not available yet" { *-*-* } }
{ dg-options "-Wformat -Wformat-diag" } */
/* Magic identifiers must be set before the attribute is used. */