summaryrefslogtreecommitdiff
path: root/gcc/c-pretty-print.c
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-16 16:01:57 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-16 16:01:57 +0000
commit2ac1e11054ba1b27fb5554489f7e24588567d4d9 (patch)
tree5f32a34bba8e5b6ed4a7e93f9ba7f8ff1df01cd4 /gcc/c-pretty-print.c
parentc7eca98668329969d87a2221b819d3c5028eef5b (diff)
downloadgcc-2ac1e11054ba1b27fb5554489f7e24588567d4d9.tar.gz
PR c/22421
* c-decl.c (c_build_bitfield_integer_type): New function. (finish_struct): Call it. * c-pretty-print.c (pp_c_type_specifier): Handle bit-field types. testsuite: * gcc.dg/format/bitfld-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102091 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-pretty-print.c')
-rw-r--r--gcc/c-pretty-print.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/gcc/c-pretty-print.c b/gcc/c-pretty-print.c
index ebd917ef20a..6276923e794 100644
--- a/gcc/c-pretty-print.c
+++ b/gcc/c-pretty-print.c
@@ -315,10 +315,21 @@ pp_c_type_specifier (c_pretty_printer *pp, tree t)
case INTEGER_TYPE:
case REAL_TYPE:
if (TYPE_NAME (t))
- t = TYPE_NAME (t);
+ {
+ t = TYPE_NAME (t);
+ pp_c_type_specifier (pp, t);
+ }
else
- t = c_common_type_for_mode (TYPE_MODE (t), TYPE_UNSIGNED (t));
- pp_c_type_specifier (pp, t);
+ {
+ int prec = TYPE_PRECISION (t);
+ t = c_common_type_for_mode (TYPE_MODE (t), TYPE_UNSIGNED (t));
+ pp_c_type_specifier (pp, t);
+ if (TYPE_PRECISION (t) != prec)
+ {
+ pp_string (pp, ":");
+ pp_decimal_int (pp, prec);
+ }
+ }
break;
case TYPE_DECL: