aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorJoseph Myers <jsm28@cam.ac.uk>2000-10-12 08:26:20 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2000-10-12 08:26:20 +0100
commit2f7026a014b970b927a12661ee9debe5ddb9458f (patch)
tree360a3d12bd9ac5b6b7248be74f575941f4d0a923 /gcc/c-common.c
parentbb58bec5cf51bf1cadf8e2462a61e965806f5c6e (diff)
downloadgcc-2f7026a014b970b927a12661ee9debe5ddb9458f.zip
gcc-2f7026a014b970b927a12661ee9debe5ddb9458f.tar.gz
gcc-2f7026a014b970b927a12661ee9debe5ddb9458f.tar.bz2
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
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c14
1 files changed, 11 insertions, 3 deletions
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