The format_char_info tables in c-format.c for our own formats contain a lot of repetition. This patch adds a macro to express the conversion specifiers implemented within pp_format, making it clearer which are custom ones added by the various diagnostic_format_decoder callbacks. Doing so uncovered a few mistakes in the data (based on comparison with the source of the diagnostic_format_decoder callbacks, and the notes below), which the patch fixes: - gcc_diag_char_table didn't have 'Z', but it *is* implemented by pp_format. - removed erroneous 'G' and 'K' entries from gcc_diag_char_table: they're implemented by default_tree_printer (and thus in "tdiag") and by the C/C++ FEs, but not in pp_format. - removed "v" (lower case) from gcc_tdiag_char_table and gcc_cxxdiag_char_table Notes: pretty-print.h uses this for ATTRIBUTE_GCC_PPDIAG, used by pp_printf and pp_verbatim: whereas diagnostic-core.h uses this for ATTRIBUTE_GCC_DIAG, used by the various diagnostic functions: /* If we haven't already defined a front-end-specific diagnostics style, use the generic one. */ Hence I'm assuming that __gcc_diag__ is for use for when we don't know what kind of diagnostic_format_decoder we have, and we can only rely on pp_format's core functionality, where __gcc_tdiag__ is allowed to assume default_tree_printer. gcc/c-family/ChangeLog: * c-format.c (PP_FORMAT_CHAR_TABLE): New macro, based on existing table entries for gcc_diag_char_table, and the 'Z' entry from gcc_tdiag_char_table, changing the "chain" entry for 'Z' from &gcc_tdiag_char_table[0] to &gcc_diag_char_table[0]. (gcc_diag_char_table): Use PP_FORMAT_CHAR_TABLE, implicitly adding missing "Z" for this table. Remove erroneous "G" and "K" entries. (gcc_tdiag_char_table): Use PP_FORMAT_CHAR_TABLE. Remove "v". (gcc_cdiag_char_table): Use PP_FORMAT_CHAR_TABLE. (gcc_cxxdiag_char_table): Use PP_FORMAT_CHAR_TABLE. Remove "v". gcc/testsuite/ChangeLog: * gcc.dg/format/gcc_diag-1.c (foo): Update the %v tests for tdiag and cxxdiag. * gcc.dg/format/gcc_diag-10.c (test_diag): Update tests of %G and %K. From-SVN: r263181
Name |
Last commit
|
Last update |
---|---|---|
INSTALL | Loading commit data... | |
config | Loading commit data... | |
contrib | Loading commit data... | |
fixincludes | Loading commit data... | |
gcc | Loading commit data... | |
gnattools | Loading commit data... | |
gotools | Loading commit data... | |
include | Loading commit data... | |
intl | Loading commit data... | |
libada | Loading commit data... | |
libatomic | Loading commit data... | |
libbacktrace | Loading commit data... | |
libcc1 | Loading commit data... | |
libcpp | Loading commit data... | |
libdecnumber | Loading commit data... | |
libffi | Loading commit data... | |
libgcc | Loading commit data... | |
libgfortran | Loading commit data... | |
libgo | Loading commit data... | |
libgomp | Loading commit data... | |
libhsail-rt | Loading commit data... | |
libiberty | Loading commit data... | |
libitm | Loading commit data... | |
libobjc | Loading commit data... | |
liboffloadmic | Loading commit data... | |
libquadmath | Loading commit data... | |
libsanitizer | Loading commit data... | |
libssp | Loading commit data... | |
libstdc++-v3 | Loading commit data... | |
libvtv | Loading commit data... | |
lto-plugin | Loading commit data... | |
maintainer-scripts | Loading commit data... | |
zlib | Loading commit data... | |
.dir-locals.el | Loading commit data... | |
.gitattributes | Loading commit data... | |
.gitignore | Loading commit data... | |
ABOUT-NLS | Loading commit data... | |
COPYING | Loading commit data... | |
COPYING.LIB | Loading commit data... | |
COPYING.RUNTIME | Loading commit data... | |
COPYING3 | Loading commit data... | |
COPYING3.LIB | Loading commit data... | |
ChangeLog | Loading commit data... | |
ChangeLog.jit | Loading commit data... | |
ChangeLog.tree-ssa | Loading commit data... | |
MAINTAINERS | Loading commit data... | |
Makefile.def | Loading commit data... | |
Makefile.in | Loading commit data... | |
Makefile.tpl | Loading commit data... | |
README | Loading commit data... | |
compile | Loading commit data... | |
config-ml.in | Loading commit data... | |
config.guess | Loading commit data... | |
config.rpath | Loading commit data... | |
config.sub | Loading commit data... | |
configure | Loading commit data... | |
configure.ac | Loading commit data... | |
depcomp | Loading commit data... | |
install-sh | Loading commit data... | |
libtool-ldflags | Loading commit data... | |
libtool.m4 | Loading commit data... | |
ltgcc.m4 | Loading commit data... | |
ltmain.sh | Loading commit data... | |
ltoptions.m4 | Loading commit data... | |
ltsugar.m4 | Loading commit data... | |
ltversion.m4 | Loading commit data... | |
lt~obsolete.m4 | Loading commit data... | |
missing | Loading commit data... | |
mkdep | Loading commit data... | |
mkinstalldirs | Loading commit data... | |
move-if-change | Loading commit data... | |
symlink-tree | Loading commit data... | |
ylwrap | Loading commit data... |