From 2f7026a014b970b927a12661ee9debe5ddb9458f Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Thu, 12 Oct 2000 08:26:20 +0100 Subject: c-common.c (print_char_table): Use the unpromoted type for lengths "h" and "hh" with conversions dioxXu. * c-common.c (print_char_table): Use the unpromoted type for lengths "h" and "hh" with conversions dioxXu. (check_format_types): Apply the default argument promotions where the wanted type is not a pointer target. From-SVN: r36841 --- gcc/ChangeLog | 7 +++++++ gcc/c-common.c | 14 +++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2d4e90b..9f7f5a0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2000-10-12 Joseph S. Myers + + * c-common.c (print_char_table): Use the unpromoted type for + lengths "h" and "hh" with conversions dioxXu. + (check_format_types): Apply the default argument promotions where + the wanted type is not a pointer target. + 2000-10-11 Michael Meeks Joseph S. Myers diff --git a/gcc/c-common.c b/gcc/c-common.c index 7efca93..0e77cdd 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -1603,9 +1603,9 @@ static const format_flag_pair strftime_flag_pairs[] = static const format_char_info print_char_table[] = { /* C89 conversion specifiers. */ - { "di", 0, STD_C89, { T89_I, T99_I, T89_I, T89_L, T99_LL, TEX_LL, T99_SST, T99_PD, T99_IM }, "-wp0 +'I", "i" }, - { "oxX", 0, STD_C89, { T89_UI, T99_UI, T89_UI, T89_UL, T99_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM }, "-wp0#", "i" }, - { "u", 0, STD_C89, { T89_UI, T99_UI, T89_UI, T89_UL, T99_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM }, "-wp0'I", "i" }, + { "di", 0, STD_C89, { T89_I, T99_SC, T89_S, T89_L, T99_LL, TEX_LL, T99_SST, T99_PD, T99_IM }, "-wp0 +'I", "i" }, + { "oxX", 0, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T99_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM }, "-wp0#", "i" }, + { "u", 0, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T99_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM }, "-wp0'I", "i" }, { "fgG", 0, STD_C89, { T89_D, BADLEN, BADLEN, T99_D, BADLEN, T89_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#'", "" }, { "eE", 0, STD_C89, { T89_D, BADLEN, BADLEN, T99_D, BADLEN, T89_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#", "" }, { "c", 0, STD_C89, { T89_I, BADLEN, BADLEN, T94_WI, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "" }, @@ -2864,6 +2864,7 @@ check_format_types (status, types) tree cur_type; tree orig_cur_type; tree wanted_type; + tree promoted_type; int arg_num; int i; int char_type_flag; @@ -2881,6 +2882,13 @@ check_format_types (status, types) if (wanted_type == void_type_node && types->pointer_count == 0) abort (); + if (types->pointer_count == 0) + { + promoted_type = simple_type_promotes_to (wanted_type); + if (promoted_type != NULL_TREE) + wanted_type = promoted_type; + } + STRIP_NOPS (cur_param); /* Check the types of any additional pointer arguments -- cgit v1.1