From 90b808077ed36cb75b4910fedbc1f130af876667 Mon Sep 17 00:00:00 2001 From: gdr Date: Wed, 17 Sep 2003 17:56:42 +0000 Subject: [PATCH] PR c++/11357 * c-pretty-print.c (pp_c_floating_constant): Append type-annotation to floating constants. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71468 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/c-pretty-print.c | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 517a876b2c6..ac84b978b30 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2003-09-17 Gabriel Dos Reis + + PR c++/11357 + * c-pretty-print.c (pp_c_floating_constant): Append + type-annotation to floating constants. + 2003-09-17 Rainer Orth * config/mips/iris5.h (TARGET_OS_CPP_BUILTINS): Define _LONGLONG. diff --git a/gcc/c-pretty-print.c b/gcc/c-pretty-print.c index 0fd5bb1e933..7b4b2733fb8 100644 --- a/gcc/c-pretty-print.c +++ b/gcc/c-pretty-print.c @@ -805,13 +805,18 @@ pp_c_enumeration_constant (c_pretty_printer *pp, tree e) return value_is_named; } -/* Print out a REAL value. */ +/* Print out a REAL value as a decimal-floating-constant. */ + static inline void pp_c_floating_constant (c_pretty_printer *pp, tree r) { real_to_decimal (pp_buffer (pp)->digit_buffer, &TREE_REAL_CST (r), sizeof (pp_buffer (pp)->digit_buffer), 0, 1); pp_string (pp, pp_buffer(pp)->digit_buffer); + if (TREE_TYPE (r) == float_type_node) + pp_character (pp, 'f'); + else if (TREE_TYPE (r) == long_double_type_node) + pp_character (pp, 'l'); } /* constant: -- 2.11.0