This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
C9x changes
- To: gcc-patches at sourceware dot cygnus dot com
- Subject: C9x changes
- From: Ulrich Drepper <drepper at cygnus dot com>
- Date: 28 Jan 2000 21:16:00 -0800
- Reply-To: drepper at cygnus dot com (Ulrich Drepper)
This patch changes all the various places where current c9x instead of
c99 is used. The missing options with the new name are added (the old
ones are left in place since 2.95 already had them), help strings,
variable names, and comments are adjusted.
--
---------------. drepper at gnu.org ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Red Hat `--' drepper at redhat.com `------------------------
2000-01-28 Ulrich Drepper <drepper@redhat.com>
* c-common.c: Adjust variable names, comments, help strings.
* c-lex.c: Likewise.
* c-parse.y: Likewise.
* c-tree.h: Likewise.
* cccp.c: Likewise.
* cpplib.h.: Likewise.
* c-decl.c: Likewise. Recognize options with names "*99" as well.
* cppinit.c: Likewise.
For cp/Changelog
2000-01-28 Ulrich Drepper <drepper@redhat.com>
* cp/decl.c: Adjust variable names, comments, help strings.
Index: c-common.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/c-common.c,v
retrieving revision 1.89
diff -u -u -w -r1.89 c-common.c
--- c-common.c 2000/01/25 17:13:13 1.89
+++ c-common.c 2000/01/29 04:34:40
@@ -271,7 +271,7 @@
declare_hidden_char_array ("__FUNCTION__", name);
declare_hidden_char_array ("__PRETTY_FUNCTION__", printable_name);
/* The ISO C people "of course" couldn't use __FUNCTION__ in the
- ISO C 9x standard; instead a new variable is invented. */
+ ISO C 99 standard; instead a new variable is invented. */
declare_hidden_char_array ("__func__", name);
}
@@ -1775,7 +1775,7 @@
else if (*format_chars == 'Z' || *format_chars == 'z')
{
length_char = *format_chars++;
- if (pedantic && (length_char == 'Z' || !flag_isoc9x))
+ if (pedantic && (length_char == 'Z' || !flag_isoc99))
warning ("ANSI C does not support the `%c' length modifier",
length_char);
}
@@ -1784,13 +1784,13 @@
if (length_char == 'l' && *format_chars == 'l')
{
length_char = 'q', format_chars++;
- if (pedantic && !flag_isoc9x)
+ if (pedantic && !flag_isoc99)
warning ("ANSI C does not support the `ll' length modifier");
}
else if (length_char == 'h' && *format_chars == 'h')
{
length_char = 'H', format_chars++;
- if (pedantic && !flag_isoc9x)
+ if (pedantic && !flag_isoc99)
warning ("ANSI C does not support the `hh' length modifier");
}
if (*format_chars == 'a' && info->format_type == scanf_format_type)
@@ -1820,7 +1820,7 @@
/* The a and A formats are C99 extensions. */
if (pedantic && info->format_type != strftime_format_type
&& (format_char == 'a' || format_char == 'A')
- && !flag_isoc9x)
+ && !flag_isoc99)
warning ("ANSI C does not support the `%c' format", format_char);
format_chars++;
switch (info->format_type)
Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/c-decl.c,v
retrieving revision 1.94
diff -u -u -w -r1.94 c-decl.c
--- c-decl.c 2000/01/25 17:13:13 1.94
+++ c-decl.c 2000/01/29 04:35:02
@@ -324,9 +324,9 @@
int flag_traditional;
-/* Nonzero means use the ISO C9x dialect of C. */
+/* Nonzero means use the ISO C99 dialect of C. */
-int flag_isoc9x = 0;
+int flag_isoc99 = 0;
/* Nonzero means that we have builtin functions, and main is an int */
@@ -508,11 +508,11 @@
recognize:
-std=iso9899:1990 same as -ansi
-std=iso9899:199409 ISO C as modified in amend. 1
- -std=iso9899:199x ISO C 9x
+ -std=iso9899:1999 ISO C 99
-std=c89 same as -std=iso9899:1990
- -std=c9x same as -std=iso9899:199x
+ -std=c99 same as -std=iso9899:1999
-std=gnu89 default, iso9899:1990 + gnu extensions
- -std=gnu9x iso9899:199x + gnu extensions
+ -std=gnu99 iso9899:1999 + gnu extensions
*/
const char *argstart = &p[5];
@@ -524,7 +524,7 @@
flag_writable_strings = 0;
flag_no_asm = 1;
flag_no_nonansi_builtin = 1;
- flag_isoc9x = 0;
+ flag_isoc99 = 0;
}
else if (!strcmp (argstart, "iso9899:199409"))
{
@@ -532,13 +532,15 @@
goto iso_1990;
}
else if (!strcmp (argstart, "iso9899:199x")
- || !strcmp (argstart, "c9x"))
+ || !strcmp (argstart, "iso9899:1999")
+ || !strcmp (argstart, "c9x")
+ || !strcmp (argstart, "c99"))
{
flag_traditional = 0;
flag_writable_strings = 0;
flag_no_asm = 1;
flag_no_nonansi_builtin = 1;
- flag_isoc9x = 1;
+ flag_isoc99 = 1;
}
else if (!strcmp (argstart, "gnu89"))
{
@@ -546,15 +548,15 @@
flag_writable_strings = 0;
flag_no_asm = 0;
flag_no_nonansi_builtin = 0;
- flag_isoc9x = 0;
+ flag_isoc99 = 0;
}
- else if (!strcmp (argstart, "gnu9x"))
+ else if (!strcmp (argstart, "gnu9x") || !strcmp (argstart, "gnu99"))
{
flag_traditional = 0;
flag_writable_strings = 0;
flag_no_asm = 0;
flag_no_nonansi_builtin = 0;
- flag_isoc9x = 1;
+ flag_isoc99 = 1;
}
else
error ("unknown C standard `%s'", argstart);
@@ -3915,12 +3919,12 @@
&& ! (specbits & (1 << (int) RID_TYPEDEF) && initialized)
&& ! in_system_header)
{
- /* Issue a warning if this is an ISO C 9x program or if -Wreturn-type
+ /* Issue a warning if this is an ISO C 99 program or if -Wreturn-type
and this is a function, or if -Wimplicit; prefer the former
warning since it is more explicit. */
if ((warn_implicit_int || warn_return_type) && funcdef_flag)
warn_about_return_type = 1;
- else if (warn_implicit_int || flag_isoc9x)
+ else if (warn_implicit_int || flag_isoc99)
warning ("type defaults to `int' in declaration of `%s'", name);
}
Index: c-lex.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/c-lex.c,v
retrieving revision 1.72
diff -u -u -w -r1.72 c-lex.c
--- c-lex.c 2000/01/25 17:13:13 1.72
+++ c-lex.c 2000/01/29 04:35:08
@@ -340,7 +340,7 @@
UNSET_RESERVED_WORD ("iterator");
UNSET_RESERVED_WORD ("complex");
}
- else if (!flag_isoc9x)
+ else if (!flag_isoc99)
UNSET_RESERVED_WORD ("restrict");
if (flag_no_asm)
Index: c-parse.y
===================================================================
RCS file: /cvs/gcc/egcs/gcc/c-parse.y,v
retrieving revision 1.31
diff -u -u -w -r1.31 c-parse.y
--- c-parse.y 2000/01/25 17:13:14 1.31
+++ c-parse.y 2000/01/29 04:35:27
@@ -474,7 +474,7 @@
tree type = $2;
finish_init ();
- if (pedantic && ! flag_isoc9x)
+ if (pedantic && ! flag_isoc99)
pedwarn ("ANSI C forbids constructor expressions");
if (TYPE_NAME (type) != 0)
{
@@ -1229,8 +1229,8 @@
poplevel (0, 0, 0); } */
| parm_declarator '[' '*' ']' %prec '.'
{ $$ = build_nt (ARRAY_REF, $1, NULL_TREE);
- if (! flag_isoc9x)
- error ("`[*]' in parameter declaration only allowed in ISO C 9x");
+ if (! flag_isoc99)
+ error ("`[*]' in parameter declaration only allowed in ISO C 99");
}
| parm_declarator '[' expr ']' %prec '.'
{ $$ = build_nt (ARRAY_REF, $1, $3); }
@@ -1263,8 +1263,8 @@
{ $$ = make_pointer_declarator ($2, $3); }
| notype_declarator '[' '*' ']' %prec '.'
{ $$ = build_nt (ARRAY_REF, $1, NULL_TREE);
- if (! flag_isoc9x)
- error ("`[*]' in parameter declaration only allowed in ISO C 9x");
+ if (! flag_isoc99)
+ error ("`[*]' in parameter declaration only allowed in ISO C 99");
}
| notype_declarator '[' expr ']' %prec '.'
{ $$ = build_nt (ARRAY_REF, $1, $3); }
@@ -1346,7 +1346,7 @@
maybecomma_warn:
/* empty */
| ','
- { if (pedantic && ! flag_isoc9x)
+ { if (pedantic && ! flag_isoc99)
pedwarn ("comma at end of enumerator list"); }
;
Index: c-tree.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/c-tree.h,v
retrieving revision 1.29
diff -u -u -w -r1.29 c-tree.h
--- c-tree.h 2000/01/25 17:13:14 1.29
+++ c-tree.h 2000/01/29 04:35:29
@@ -403,9 +403,9 @@
extern int flag_traditional;
-/* Nonzero means use the ISO C9x dialect of C. */
+/* Nonzero means use the ISO C99 dialect of C. */
-extern int flag_isoc9x;
+extern int flag_isoc99;
/* Nonzero means to allow single precision math even if we're generally
being traditional. */
Index: cccp.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cccp.c,v
retrieving revision 1.94
diff -u -u -w -r1.94 cccp.c
--- cccp.c 2000/01/14 00:46:56 1.94
+++ cccp.c 2000/01/29 04:36:02
@@ -256,9 +256,9 @@
int c89;
-/* Nonzero for the 199x C Standard. */
+/* Nonzero for the 1999 C Standard. */
-int c9x;
+int c99;
/* Nonzero causes output not to be done,
but directives such as #define that have side effects
@@ -581,7 +581,7 @@
#define REST_EXTENSION_LENGTH (sizeof (rest_extension) - 1)
/* This is the implicit parameter name when using variable number of
- parameters for macros using the ISO C 9x extension. */
+ parameters for macros using the ISO C 99 extension. */
static char va_args_name[] = "__VA_ARGS__";
#define VA_ARGS_NAME_LENGTH (sizeof (va_args_name) - 1)
@@ -1128,8 +1128,8 @@
printf (" -lang-fortran Assume that the input sources are in Fortran\n");
printf (" -lang-chill Assume that the input sources are in Chill\n");
printf (" -std=<std name> Specify the conformance standard; one of:\n");
- printf (" gnu89, gnu9x, c89, c9x, iso9899:1990,\n");
- printf (" iso9899:199409, iso9899:199x\n");
+ printf (" gnu89, gnu99, c89, c99, iso9899:1990,\n");
+ printf (" iso9899:199409, iso9899:1999\n");
printf (" -+ Allow parsing of C++ style features\n");
printf (" -w Inhibit warning messages\n");
printf (" -Wtrigraphs Warn if trigraphs are encountered\n");
@@ -1445,19 +1445,19 @@
case 'l':
if (! strcmp (argv[i], "-lang-c"))
- cplusplus = 0, cplusplus_comments = 1, c89 = 0, c9x = 1, objc = 0;
+ cplusplus = 0, cplusplus_comments = 1, c89 = 0, c99 = 1, objc = 0;
else if (! strcmp (argv[i], "-lang-c89"))
{
- cplusplus = 0, cplusplus_comments = 0, c89 = 1, c9x = 0, objc = 0;
+ cplusplus = 0, cplusplus_comments = 0, c89 = 1, c99 = 0, objc = 0;
no_trigraphs = 0;
pend_defs[2*i] = "__STRICT_ANSI__";
}
else if (! strcmp (argv[i], "-lang-c++"))
- cplusplus = 1, cplusplus_comments = 1, c89 = 0, c9x = 0, objc = 0;
+ cplusplus = 1, cplusplus_comments = 1, c89 = 0, c99 = 0, objc = 0;
else if (! strcmp (argv[i], "-lang-objc"))
- cplusplus = 0, cplusplus_comments = 1, c89 = 0, c9x = 0, objc = 1;
+ cplusplus = 0, cplusplus_comments = 1, c89 = 0, c99 = 0, objc = 1;
else if (! strcmp (argv[i], "-lang-objc++"))
- cplusplus = 1, cplusplus_comments = 1, c89 = 0, c9x = 0, objc = 1;
+ cplusplus = 1, cplusplus_comments = 1, c89 = 0, c99 = 0, objc = 1;
else if (! strcmp (argv[i], "-lang-asm"))
lang_asm = 1;
else if (! strcmp (argv[i], "-lang-fortran"))
@@ -1473,24 +1473,24 @@
case 's':
if (!strcmp (argv[i], "-std=gnu89"))
{
- cplusplus = 0, cplusplus_comments = 0, c89 = 1, c9x = 0, objc = 0;
+ cplusplus = 0, cplusplus_comments = 0, c89 = 1, c99 = 0, objc = 0;
}
else if (!strcmp (argv[i], "-std=gnu9x")
|| !strcmp (argv[i], "-std=gnu99"))
{
- cplusplus = 0, cplusplus_comments = 1, c89 = 0, c9x = 1, objc = 0;
+ cplusplus = 0, cplusplus_comments = 1, c89 = 0, c99 = 1, objc = 0;
pend_defs[2*i+1] = "__STDC_VERSION__=199901L";
}
else if (!strcmp (argv[i], "-std=iso9899:1990")
|| !strcmp (argv[i], "-std=c89"))
{
- cplusplus = 0, cplusplus_comments = 0, c89 = 1, c9x = 0, objc = 0;
+ cplusplus = 0, cplusplus_comments = 0, c89 = 1, c99 = 0, objc = 0;
no_trigraphs = 0;
pend_defs[2*i] = "__STRICT_ANSI__";
}
else if (!strcmp (argv[i], "-std=iso9899:199409"))
{
- cplusplus = 0, cplusplus_comments = 0, c89 = 1, c9x = 0, objc = 0;
+ cplusplus = 0, cplusplus_comments = 0, c89 = 1, c99 = 0, objc = 0;
no_trigraphs = 0;
pend_defs[2*i] = "__STRICT_ANSI__";
pend_defs[2*i+1] = "__STDC_VERSION__=199409L";
@@ -1500,7 +1500,7 @@
|| !strcmp (argv[i], "-std=c9x")
|| !strcmp (argv[i], "-std=c99"))
{
- cplusplus = 0, cplusplus_comments = 1, c89 = 0, c9x = 1, objc = 0;
+ cplusplus = 0, cplusplus_comments = 1, c89 = 0, c99 = 1, objc = 0;
no_trigraphs = 0;
pend_defs[2*i] = "__STRICT_ANSI__";
pend_defs[2*i+1] = "__STDC_VERSION__=199901L";
@@ -5845,10 +5845,10 @@
if (!is_idstart[*bp])
{
- if (c9x && limit - bp > (long) REST_EXTENSION_LENGTH
+ if (c99 && limit - bp > (long) REST_EXTENSION_LENGTH
&& bcmp (rest_extension, bp, REST_EXTENSION_LENGTH) == 0)
{
- /* This is the ISO C 9x way to write macros with variable
+ /* This is the ISO C 99 way to write macros with variable
number of arguments. */
rest_args = 1;
temp->rest_args = 1;
@@ -5872,7 +5872,7 @@
}
if (bp == temp->name && rest_args == 1)
{
- /* This is the ISO C 9x style. */
+ /* This is the ISO C 99 style. */
temp->name = (U_CHAR *) va_args_name;
temp->length = VA_ARGS_NAME_LENGTH;
}
@@ -5891,7 +5891,7 @@
SKIP_WHITE_SPACE (bp);
/* A comma at this point can only be followed by an identifier. */
if (!is_idstart[*bp]
- && !(c9x && limit - bp > (long) REST_EXTENSION_LENGTH
+ && !(c99 && limit - bp > (long) REST_EXTENSION_LENGTH
&& bcmp (rest_extension, bp, REST_EXTENSION_LENGTH) == 0)) {
error ("badly punctuated parameter list in `#define'");
goto nope;
Index: cpphash.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cpphash.c,v
retrieving revision 1.30
diff -u -u -w -r1.30 cpphash.c
--- cpphash.c 2000/01/22 04:18:41 1.30
+++ cpphash.c 2000/01/29 04:36:15
@@ -737,7 +737,7 @@
SKIP_WHITE_SPACE (bp);
}
else
- /* Per C9x, missing white space after the name in a #define
+ /* Per C99, missing white space after the name in a #define
of an object-like macro is always a constraint violation. */
cpp_pedwarn (pfile,
"missing white space after `#define %.*s'",
Index: cppinit.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cppinit.c,v
retrieving revision 1.32
diff -u -u -w -r1.32 cppinit.c
--- cppinit.c 2000/01/27 22:29:06 1.32
+++ cppinit.c 2000/01/29 04:36:20
@@ -1,5 +1,5 @@
/* CPP Library.
- Copyright (C) 1986, 87, 89, 92-98, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1986, 87, 89, 92-98, 1999, 2000 Free Software Foundation, Inc.
Contributed by Per Bothner, 1994-95.
Based on CCCP program by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987
@@ -1310,23 +1310,23 @@
case 'l':
if (! strcmp (argv[i], "-lang-c"))
opts->cplusplus = 0, opts->cplusplus_comments = 1, opts->c89 = 0,
- opts->c9x = 1, opts->objc = 0;
+ opts->c99 = 1, opts->objc = 0;
if (! strcmp (argv[i], "-lang-c89"))
{
opts->cplusplus = 0, opts->cplusplus_comments = 0;
- opts->c89 = 1, opts->c9x = 0, opts->objc = 0;
+ opts->c89 = 1, opts->c99 = 0, opts->objc = 0;
opts->trigraphs = 1;
new_pending_define (opts, "__STRICT_ANSI__");
}
if (! strcmp (argv[i], "-lang-c++"))
opts->cplusplus = 1, opts->cplusplus_comments = 1, opts->c89 = 0,
- opts->c9x = 0, opts->objc = 0;
+ opts->c99 = 0, opts->objc = 0;
if (! strcmp (argv[i], "-lang-objc"))
opts->cplusplus = 0, opts->cplusplus_comments = 1, opts->c89 = 0,
- opts->c9x = 0, opts->objc = 1;
+ opts->c99 = 0, opts->objc = 1;
if (! strcmp (argv[i], "-lang-objc++"))
opts->cplusplus = 1, opts->cplusplus_comments = 1, opts->c89 = 0,
- opts->c9x = 0, opts->objc = 1;
+ opts->c99 = 0, opts->objc = 1;
if (! strcmp (argv[i], "-lang-asm"))
opts->lang_asm = 1;
if (! strcmp (argv[i], "-lang-fortran"))
@@ -1346,26 +1346,27 @@
if (!strcmp (argv[i], "-std=gnu89"))
{
opts->cplusplus = 0, opts->cplusplus_comments = 1;
- opts->c89 = 1, opts->c9x = 0, opts->objc = 0;
+ opts->c89 = 1, opts->c99 = 0, opts->objc = 0;
}
- else if (!strcmp (argv[i], "-std=gnu9x"))
+ else if (!strcmp (argv[i], "-std=gnu9x")
+ || !strcmp (argv[i], "-std=gnu99"))
{
opts->cplusplus = 0, opts->cplusplus_comments = 1;
- opts->c89 = 0, opts->c9x = 1, opts->objc = 0;
+ opts->c89 = 0, opts->c99 = 1, opts->objc = 0;
new_pending_define (opts, "__STDC_VERSION__=199901L");
}
else if (!strcmp (argv[i], "-std=iso9899:1990")
|| !strcmp (argv[i], "-std=c89"))
{
opts->cplusplus = 0, opts->cplusplus_comments = 0;
- opts->c89 = 1, opts->c9x = 0, opts->objc = 0;
+ opts->c89 = 1, opts->c99 = 0, opts->objc = 0;
opts->trigraphs = 1;
new_pending_define (opts, "__STRICT_ANSI__");
}
else if (!strcmp (argv[i], "-std=iso9899:199409"))
{
opts->cplusplus = 0, opts->cplusplus_comments = 0;
- opts->c89 = 1, opts->c9x = 0, opts->objc = 0;
+ opts->c89 = 1, opts->c99 = 0, opts->objc = 0;
opts->trigraphs = 1;
new_pending_define (opts, "__STRICT_ANSI__");
new_pending_define (opts, "__STDC_VERSION__=199409L");
@@ -1376,7 +1377,7 @@
|| !strcmp (argv[i], "-std=c99"))
{
opts->cplusplus = 0, opts->cplusplus_comments = 1;
- opts->c89 = 0, opts->c9x = 1, opts->objc = 0;
+ opts->c89 = 0, opts->c99 = 1, opts->objc = 0;
opts->trigraphs = 1;
new_pending_define (opts, "__STRICT_ANSI__");
new_pending_define (opts, "__STDC_VERSION__=199901L");
@@ -1717,8 +1718,8 @@
-lang-fortran Assume that the input sources are in Fortran\n\
-lang-chill Assume that the input sources are in Chill\n\
-std=<std name> Specify the conformance standard; one of:\n\
- gnu89, gnu9x, c89, c9x, iso9899:1990,\n\
- iso9899:199409, iso9899:199x\n\
+ gnu89, gnu99, c89, c99, iso9899:1990,\n\
+ iso9899:199409, iso9899:1999\n\
-+ Allow parsing of C++ style features\n\
-w Inhibit warning messages\n\
-Wtrigraphs Warn if trigraphs are encountered\n\
Index: cpplib.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cpplib.h,v
retrieving revision 1.48
diff -u -u -w -r1.48 cpplib.h
--- cpplib.h 2000/01/27 22:29:07 1.48
+++ cpplib.h 2000/01/29 04:36:23
@@ -465,8 +465,8 @@
/* Nonzero for the 1989 C Standard, including corrigenda and amendments. */
char c89;
- /* Nonzero for the 199x C Standard, including corrigenda and amendments. */
- char c9x;
+ /* Nonzero for the 1999 C Standard, including corrigenda and amendments. */
+ char c99;
/* Nonzero means give all the error messages the ANSI standard requires. */
char pedantic;
@@ -806,4 +806,3 @@
}
#endif
#endif /* __GCC_CPPLIB__ */
-
Index: cp/decl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl.c,v
retrieving revision 1.538
diff -u -u -w -r1.538 decl.c
--- decl.c 2000/01/26 20:51:33 1.538
+++ decl.c 2000/01/29 04:37:21
@@ -324,9 +324,9 @@
tree current_function_return_value;
-/* Nonzero means use the ISO C9x dialect of C. */
+/* Nonzero means use the ISO C99 dialect of C. */
-int flag_isoc9x;
+int flag_isoc99;
/* Nonzero means give `double' the same size as `float'. */