r265919 - in /trunk/gcc: ChangeLog c-family/Cha...

dmalcolm@gcc.gnu.org dmalcolm@gcc.gnu.org
Thu Nov 8 15:31:00 GMT 2018


Author: dmalcolm
Date: Thu Nov  8 15:31:13 2018
New Revision: 265919

URL: https://gcc.gnu.org/viewcvs?rev=265919&root=gcc&view=rev
Log:
Support %f in pp_format

Numerous formatted messages from the inliner use %f, mostly as %f, but
occasionally with length modifiers.

This patch implements the simplest case of "%f" for pp_format (with no
modifier support) to make it easier to port these messages from fprintf
to dump_printf_loc.

The selftest has an assertion that %f on 1.0 is printed as "1.000000".
This comes from the host's sprintf, and I believe this is guaranteed by
POSIX: "If the precision is missing, it shall be taken as 6".  If this is
an issue I can drop the selftest.

gcc/c-family/ChangeLog:
	* c-format.c (gcc_dump_printf_char_table): Add entry for %f.

gcc/ChangeLog:
	* pretty-print.c (pp_format): Handle %f.
	(selftest::test_pp_format): Add test of %f.
	* pretty-print.h (pp_double): New macro.

gcc/testsuite/ChangeLog:
	* gcc.dg/format/gcc_diag-10.c: Add coverage for %f.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-family/ChangeLog
    trunk/gcc/c-family/c-format.c
    trunk/gcc/pretty-print.c
    trunk/gcc/pretty-print.h
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/format/gcc_diag-10.c



More information about the Gcc-cvs mailing list