Commit 4e1e5460 by Joseph Myers Committed by Joseph Myers

c-common.c (time_char_table): Mark up formats added in C99 and make other corrections.

	* c-common.c (time_char_table): Mark up formats added in C99 and
	make other corrections.  %D and %g were added in C99.  %Og is an
	extension.  %EX is permitted.  %R, %T, %n, %r, %t were added in
	C99.  %e was added in C99.  %Oj is an extension.  %G and %z are in
	C99 rather than GNU extensions, but %OG and %Oz are extensions.
	%h was added in C99.  %C was added in C99.  %OY and %OC are
	extensions.  Add the C99 format %F.
	(check_format_info): If pedantic and not in C99 mode, warn for C99
	formats, %E and %O.

From-SVN: r35496
parent 018577e4
2000-08-04 Joseph S. Myers <jsm28@cam.ac.uk>
* c-common.c (time_char_table): Mark up formats added in C99 and
make other corrections. %D and %g were added in C99. %Og is an
extension. %EX is permitted. %R, %T, %n, %r, %t were added in
C99. %e was added in C99. %Oj is an extension. %G and %z are in
C99 rather than GNU extensions, but %OG and %Oz are extensions.
%h was added in C99. %C was added in C99. %OY and %OC are
extensions. Add the C99 format %F.
(check_format_info): If pedantic and not in C99 mode, warn for C99
formats, %E and %O.
Fri Aug 4 23:01:58 2000 J"orn Rennecke <amylaar@cygnus.co.uk> Fri Aug 4 23:01:58 2000 J"orn Rennecke <amylaar@cygnus.co.uk>
* function.c (schedule_fixup_var_refs): New function, broken out * function.c (schedule_fixup_var_refs): New function, broken out
......
...@@ -1268,22 +1268,31 @@ static format_char_info scan_char_table[] = { ...@@ -1268,22 +1268,31 @@ static format_char_info scan_char_table[] = {
'E' - E modifier is acceptable 'E' - E modifier is acceptable
'O' - O modifier is acceptable to Standard C 'O' - O modifier is acceptable to Standard C
'o' - O modifier is acceptable as a GNU extension 'o' - O modifier is acceptable as a GNU extension
'9' - added to the C standard in C99
'G' - other GNU extensions */ 'G' - other GNU extensions */
static format_char_info time_char_table[] = { static format_char_info time_char_table[] = {
{ "y", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "2EO-_0w" }, { "y", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "2EO-_0w" },
{ "D", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "2" }, { "D", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "29" },
{ "g", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "2O-_0w" }, { "g", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "2Oo-_0w9" },
{ "cx", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "3E" }, { "cx", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "3E" },
{ "%RTXnrt", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "" }, { "%", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "" },
{ "X", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "E" },
{ "RTnrt", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "9" },
{ "P", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "G" }, { "P", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "G" },
{ "HIMSUWdemw", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "-_0Ow" }, { "HIMSUWdmw", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "-_0Ow" },
{ "Vju", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "-_0Oow" }, { "e", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "-_0Ow9" },
{ "Gklsz", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "-_0OGw" }, { "j", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "-_0Oow" },
{ "Vu", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "-_0Ow9" },
{ "Gz", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "-_0Oow9" },
{ "kls", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "-_0OGw" },
{ "ABZa", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "^#" }, { "ABZa", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "^#" },
{ "p", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "#" }, { "p", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "#" },
{ "bh", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "^" }, { "b", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "^" },
{ "CY", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "-_0EOw" }, { "h", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "^9" },
{ "Y", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "-_0EOow" },
{ "F", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "w9" },
{ "C", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "-_0EOow9" },
{ NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL } { NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
}; };
...@@ -1900,9 +1909,14 @@ check_format_info (info, params) ...@@ -1900,9 +1909,14 @@ check_format_info (info, params)
{ {
if (index (fci->flag_chars, 'G') != 0) if (index (fci->flag_chars, 'G') != 0)
warning ("ANSI C does not support `%%%c'", format_char); warning ("ANSI C does not support `%%%c'", format_char);
if (index (fci->flag_chars, 'o') != 0 if (index (fci->flag_chars, '9') != 0 && !flag_isoc99)
warning ("ANSI C does not support `%%%c'", format_char);
if ((index (fci->flag_chars, 'o') != 0
|| (!flag_isoc99 && index (fci->flag_chars, 'O') != 0))
&& index (flag_chars, 'O') != 0) && index (flag_chars, 'O') != 0)
warning ("ANSI C does not support `%%O%c'", format_char); warning ("ANSI C does not support `%%O%c'", format_char);
if (!flag_isoc99 && index (flag_chars, 'E'))
warning ("ANSI C does not support `%%E%c'", format_char);
} }
if (wide && index (fci->flag_chars, 'w') == 0) if (wide && index (fci->flag_chars, 'w') == 0)
warning ("width used with `%c' format", format_char); warning ("width used with `%c' format", format_char);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment