diff options
author | Joseph Myers <jsm28@cam.ac.uk> | 2000-08-05 19:31:15 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2000-08-05 19:31:15 +0100 |
commit | c16dc93614b58085227737abf5642fd573c4ca22 (patch) | |
tree | fc9c765c73ce9eb1863a722c2d642a0a37f2a845 /gcc | |
parent | 26f2c02a97d337b9d4f00067957ad86db350cc2c (diff) | |
download | gcc-c16dc93614b58085227737abf5642fd573c4ca22.zip gcc-c16dc93614b58085227737abf5642fd573c4ca22.tar.gz gcc-c16dc93614b58085227737abf5642fd573c4ca22.tar.bz2 |
c-common.c (print_char_table): Add entries for the X/Open ' format flag (print decimals with locale's...
* c-common.c (print_char_table): Add entries for the X/Open '
format flag (print decimals with locale's thousands grouping
character). Make %C expect wint_t.
(check_format_info): If pedantic, warn when the %n$ operand
number form is used. Allow for the ' flag; warn about it if
pedantic.
From-SVN: r35507
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/c-common.c | 16 |
2 files changed, 20 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 78006cf..b9c6caf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2000-08-05 Joseph S. Myers <jsm28@cam.ac.uk> + + * c-common.c (print_char_table): Add entries for the X/Open ' + format flag (print decimals with locale's thousands grouping + character). Make %C expect wint_t. + (check_format_info): If pedantic, warn when the %n$ operand + number form is used. Allow for the ' flag; warn about it if + pedantic. + 2000-08-05 Zack Weinberg <zack@wolery.cumb.org> * i386.h (FUNCTION_OK_FOR_SIBCALL): Not OK if DECL's return diff --git a/gcc/c-common.c b/gcc/c-common.c index 0814c4d..64df897 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -1233,14 +1233,15 @@ typedef struct { } format_char_info; static format_char_info print_char_table[] = { - { "di", 0, T_I, T_I, T_I, T_L, T_LL, T_LL, T_ST, T_PD, T_IM, "-wp0 +" }, + { "di", 0, T_I, T_I, T_I, T_L, T_LL, T_LL, T_ST, T_PD, T_IM, "-wp0 +'" }, { "oxX", 0, T_UI, T_UI, T_UI, T_UL, T_ULL, T_ULL, T_ST, T_PD, T_UIM, "-wp0#" }, - { "u", 0, T_UI, T_UI, T_UI, T_UL, T_ULL, T_ULL, T_ST, T_PD, T_UIM, "-wp0" }, + { "u", 0, T_UI, T_UI, T_UI, T_UL, T_ULL, T_ULL, T_ST, T_PD, T_UIM, "-wp0'" }, /* A GNU extension. */ { "m", 0, T_V, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "-wp" }, - { "fFeEgGaA", 0, T_D, NULL, NULL, T_D, NULL, T_LD, NULL, NULL, NULL, "-wp0 +#" }, + { "fFgG", 0, T_D, NULL, NULL, T_D, NULL, T_LD, NULL, NULL, NULL, "-wp0 +#'" }, + { "eEaA", 0, T_D, NULL, NULL, T_D, NULL, T_LD, NULL, NULL, NULL, "-wp0 +#" }, { "c", 0, T_I, NULL, NULL, T_WI, NULL, NULL, NULL, NULL, NULL, "-w" }, - { "C", 0, T_W, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "-w" }, + { "C", 0, T_WI, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "-w" }, { "s", 1, T_C, NULL, NULL, T_W, NULL, NULL, NULL, NULL, NULL, "-wp" }, { "S", 1, T_W, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "-wp" }, { "p", 1, T_V, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "-w" }, @@ -1699,6 +1700,9 @@ check_format_info (info, params) { int opnum = atoi (format_chars); + if (pedantic) + warning ("ANSI C does not support printf %%n$"); + params = first_fillin_param; format_chars = p + 1; has_operand_number = 1; @@ -1714,7 +1718,7 @@ check_format_info (info, params) } } - while (*format_chars != 0 && index (" +#0-", *format_chars) != 0) + while (*format_chars != 0 && index (" +#0-'", *format_chars) != 0) { if (index (flag_chars, *format_chars) != 0) warning ("repeated `%c' flag in format", *format_chars++); @@ -1735,6 +1739,8 @@ check_format_info (info, params) if (index (flag_chars, '0') != 0 && index (flag_chars, '-') != 0) warning ("use of both `0' and `-' flags in format"); + if (index (flag_chars, '\'') && pedantic) + warning ("ANSI C does not support the `'' format flag"); if (*format_chars == '*') { wide = TRUE; |