From e21239a3dfd5281f2c8deb7c048ffba65db1da02 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Mon, 17 Jul 2000 03:07:08 -0600 Subject: [PATCH] c-common.c (scan_char_table): Allow "z" length modifiers on diouxXn formats. * c-common.c (scan_char_table): Allow "z" length modifiers on diouxXn formats. (check_format_info): Use TYPE_DOMAIN on the type matched against for "z" formats, to retrieve the language size_t rather than the internal one. From-SVN: r35083 --- gcc/ChangeLog | 6 ++++++ gcc/c-common.c | 12 ++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1e3ac965b9b..504431c766e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -20,6 +20,12 @@ Mon Jul 17 02:37:06 2000 Marc Espie 2000-07-17 Joseph S. Myers + * c-common.c (scan_char_table): Allow "z" length modifiers on + diouxXn formats. + (check_format_info): Use TYPE_DOMAIN on the type matched against + for "z" formats, to retrieve the language size_t rather than the + internal one. + * c-common.c (check_format_info): Do not make a pedantic objection to the 'L' length modifier if used with a floating point type character. diff --git a/gcc/c-common.c b/gcc/c-common.c index 1e31b29e9f1..c7b56012206 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -1239,8 +1239,8 @@ static format_char_info print_char_table[] = { }; static format_char_info scan_char_table[] = { - { "di", 1, T_I, T_C, T_S, T_L, T_LL, T_LL, NULL, "*" }, - { "ouxX", 1, T_UI, T_UC, T_US, T_UL, T_ULL, T_ULL, NULL, "*" }, + { "di", 1, T_I, T_C, T_S, T_L, T_LL, T_LL, T_ST, "*" }, + { "ouxX", 1, T_UI, T_UC, T_US, T_UL, T_ULL, T_ULL, T_ST, "*" }, { "efgEGaA", 1, T_F, NULL, NULL, T_D, NULL, T_LD, NULL, "*" }, { "c", 1, T_C, NULL, NULL, T_W, NULL, NULL, NULL, "*" }, { "s", 1, T_C, NULL, NULL, T_W, NULL, NULL, NULL, "*a" }, @@ -1248,7 +1248,7 @@ static format_char_info scan_char_table[] = { { "C", 1, T_W, NULL, NULL, NULL, NULL, NULL, NULL, "*" }, { "S", 1, T_W, NULL, NULL, NULL, NULL, NULL, NULL, "*a" }, { "p", 2, T_V, NULL, NULL, NULL, NULL, NULL, NULL, "*" }, - { "n", 1, T_I, T_C, T_S, T_L, T_LL, NULL, NULL, "" }, + { "n", 1, T_I, T_C, T_S, T_L, T_LL, NULL, T_ST, "" }, { NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL } }; @@ -1931,7 +1931,11 @@ check_format_info (info, params) case 'l': wanted_type = fci->llen ? *(fci->llen) : 0; break; case 'q': wanted_type = fci->qlen ? *(fci->qlen) : 0; break; case 'L': wanted_type = fci->bigllen ? *(fci->bigllen) : 0; break; - case 'z': case 'Z': wanted_type = fci->zlen ? *fci->zlen : 0; break; + case 'z': case 'Z': wanted_type = (fci->zlen + ? (TYPE_DOMAIN (*fci->zlen) + ? TYPE_DOMAIN (*fci->zlen) + : *fci->zlen) + : 0); break; } if (wanted_type == 0) warning ("use of `%c' length character with `%c' type character",