aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2020-04-29 22:41:47 +0200
committerJakub Jelinek <jakub@redhat.com>2020-04-29 22:41:47 +0200
commit691eeb65a01dab3084b6ce381737adf097bd2e65 (patch)
tree0d1b729fa533287e181c110c95c7543f9571e358 /gcc/c-family
parent48e54fea7ba4a7cb7b3d1505951383120220e394 (diff)
downloadgcc-691eeb65a01dab3084b6ce381737adf097bd2e65.zip
gcc-691eeb65a01dab3084b6ce381737adf097bd2e65.tar.gz
gcc-691eeb65a01dab3084b6ce381737adf097bd2e65.tar.bz2
diagnostics: Add %{...%} pretty-format support for URLs and use it in -Wpsabi diagnostics
The following patch attempts to use the diagnostics URL support if available to provide more information about the C++17 empty base and C++20 [[no_unique_address]] empty class ABI changes in -Wpsabi diagnostics. in GCC 10.1 at the end of the diagnostics is then in some terminals underlined with a dotted line and points to a (to be written) anchor in gcc-10/changes.html which we need to write anyway. 2020-04-29 Jakub Jelinek <jakub@redhat.com> * configure.ac (-with-changes-root-url): New configure option, defaulting to https://gcc.gnu.org/. * Makefile.in (CFLAGS-opts.o): Define CHANGES_ROOT_URL for opts.c. * pretty-print.c (get_end_url_string): New function. (pp_format): Handle %{ and %} for URLs. (pp_begin_url): Use pp_string instead of pp_printf. (pp_end_url): Use get_end_url_string. * opts.h (get_changes_url): Declare. * opts.c (get_changes_url): New function. * config/rs6000/rs6000-call.c: Include opts.h. (rs6000_discover_homogeneous_aggregate): Use %{in GCC 10.1%} instead of just in GCC 10.1 in diagnostics and add URL. * config/arm/arm.c (aapcs_vfp_is_call_or_return_candidate): Likewise. * config/aarch64/aarch64.c (aarch64_vfp_is_call_or_return_candidate): Likewise. * config/s390/s390.c (s390_function_arg_vector, s390_function_arg_float): Likewise. * configure: Regenerated. * c-format.c (PP_FORMAT_CHAR_TABLE): Add %{ and %}.
Diffstat (limited to 'gcc/c-family')
-rw-r--r--gcc/c-family/ChangeLog4
-rw-r--r--gcc/c-family/c-format.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 973dc70..c429b49 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,7 @@
+2020-04-29 Jakub Jelinek <jakub@redhat.com>
+
+ * c-format.c (PP_FORMAT_CHAR_TABLE): Add %{ and %}.
+
2020-04-27 Jakub Jelinek <jakub@redhat.com>
PR c/94755
diff --git a/gcc/c-family/c-format.c b/gcc/c-family/c-format.c
index 51fd31e..33a5b6d 100644
--- a/gcc/c-family/c-format.c
+++ b/gcc/c-family/c-format.c
@@ -757,6 +757,8 @@ static const format_char_info asm_fprintf_char_table[] =
{ "<", 0, STD_C89, NOARGUMENTS, "", "<", NULL }, \
{ ">", 0, STD_C89, NOARGUMENTS, "", ">", NULL }, \
{ "'" , 0, STD_C89, NOARGUMENTS, "", "", NULL }, \
+ { "{", 1, STD_C89, { T89_C, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "cR", NULL }, \
+ { "}", 0, STD_C89, NOARGUMENTS, "", "", NULL }, \
{ "R", 0, STD_C89, NOARGUMENTS, "", "\\", NULL }, \
{ "m", 0, STD_C89, NOARGUMENTS, "q", "", NULL }, \
{ "Z", 1, STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "", &gcc_diag_char_table[0] }