Commit 31948547 by Ulrich Drepper

Adjust variable names, comments, help strings to c99.

From-SVN: r31689
parent 10b52f46
...@@ -271,7 +271,7 @@ declare_function_name () ...@@ -271,7 +271,7 @@ declare_function_name ()
declare_hidden_char_array ("__FUNCTION__", name); declare_hidden_char_array ("__FUNCTION__", name);
declare_hidden_char_array ("__PRETTY_FUNCTION__", printable_name); declare_hidden_char_array ("__PRETTY_FUNCTION__", printable_name);
/* The ISO C people "of course" couldn't use __FUNCTION__ in the /* 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); declare_hidden_char_array ("__func__", name);
} }
...@@ -1775,7 +1775,7 @@ check_format_info (info, params) ...@@ -1775,7 +1775,7 @@ check_format_info (info, params)
else if (*format_chars == 'Z' || *format_chars == 'z') else if (*format_chars == 'Z' || *format_chars == 'z')
{ {
length_char = *format_chars++; 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", warning ("ANSI C does not support the `%c' length modifier",
length_char); length_char);
} }
...@@ -1784,13 +1784,13 @@ check_format_info (info, params) ...@@ -1784,13 +1784,13 @@ check_format_info (info, params)
if (length_char == 'l' && *format_chars == 'l') if (length_char == 'l' && *format_chars == 'l')
{ {
length_char = 'q', format_chars++; length_char = 'q', format_chars++;
if (pedantic && !flag_isoc9x) if (pedantic && !flag_isoc99)
warning ("ANSI C does not support the `ll' length modifier"); warning ("ANSI C does not support the `ll' length modifier");
} }
else if (length_char == 'h' && *format_chars == 'h') else if (length_char == 'h' && *format_chars == 'h')
{ {
length_char = 'H', format_chars++; length_char = 'H', format_chars++;
if (pedantic && !flag_isoc9x) if (pedantic && !flag_isoc99)
warning ("ANSI C does not support the `hh' length modifier"); warning ("ANSI C does not support the `hh' length modifier");
} }
if (*format_chars == 'a' && info->format_type == scanf_format_type) if (*format_chars == 'a' && info->format_type == scanf_format_type)
...@@ -1820,7 +1820,7 @@ check_format_info (info, params) ...@@ -1820,7 +1820,7 @@ check_format_info (info, params)
/* The a and A formats are C99 extensions. */ /* The a and A formats are C99 extensions. */
if (pedantic && info->format_type != strftime_format_type if (pedantic && info->format_type != strftime_format_type
&& (format_char == 'a' || format_char == 'A') && (format_char == 'a' || format_char == 'A')
&& !flag_isoc9x) && !flag_isoc99)
warning ("ANSI C does not support the `%c' format", format_char); warning ("ANSI C does not support the `%c' format", format_char);
format_chars++; format_chars++;
switch (info->format_type) switch (info->format_type)
......
...@@ -340,7 +340,7 @@ init_lex () ...@@ -340,7 +340,7 @@ init_lex ()
UNSET_RESERVED_WORD ("iterator"); UNSET_RESERVED_WORD ("iterator");
UNSET_RESERVED_WORD ("complex"); UNSET_RESERVED_WORD ("complex");
} }
else if (!flag_isoc9x) else if (!flag_isoc99)
UNSET_RESERVED_WORD ("restrict"); UNSET_RESERVED_WORD ("restrict");
if (flag_no_asm) if (flag_no_asm)
......
...@@ -474,7 +474,7 @@ cast_expr: ...@@ -474,7 +474,7 @@ cast_expr:
tree type = $2; tree type = $2;
finish_init (); finish_init ();
if (pedantic && ! flag_isoc9x) if (pedantic && ! flag_isoc99)
pedwarn ("ANSI C forbids constructor expressions"); pedwarn ("ANSI C forbids constructor expressions");
if (TYPE_NAME (type) != 0) if (TYPE_NAME (type) != 0)
{ {
...@@ -1229,8 +1229,8 @@ parm_declarator: ...@@ -1229,8 +1229,8 @@ parm_declarator:
poplevel (0, 0, 0); } */ poplevel (0, 0, 0); } */
| parm_declarator '[' '*' ']' %prec '.' | parm_declarator '[' '*' ']' %prec '.'
{ $$ = build_nt (ARRAY_REF, $1, NULL_TREE); { $$ = build_nt (ARRAY_REF, $1, NULL_TREE);
if (! flag_isoc9x) if (! flag_isoc99)
error ("`[*]' in parameter declaration only allowed in ISO C 9x"); error ("`[*]' in parameter declaration only allowed in ISO C 99");
} }
| parm_declarator '[' expr ']' %prec '.' | parm_declarator '[' expr ']' %prec '.'
{ $$ = build_nt (ARRAY_REF, $1, $3); } { $$ = build_nt (ARRAY_REF, $1, $3); }
...@@ -1263,8 +1263,8 @@ notype_declarator: ...@@ -1263,8 +1263,8 @@ notype_declarator:
{ $$ = make_pointer_declarator ($2, $3); } { $$ = make_pointer_declarator ($2, $3); }
| notype_declarator '[' '*' ']' %prec '.' | notype_declarator '[' '*' ']' %prec '.'
{ $$ = build_nt (ARRAY_REF, $1, NULL_TREE); { $$ = build_nt (ARRAY_REF, $1, NULL_TREE);
if (! flag_isoc9x) if (! flag_isoc99)
error ("`[*]' in parameter declaration only allowed in ISO C 9x"); error ("`[*]' in parameter declaration only allowed in ISO C 99");
} }
| notype_declarator '[' expr ']' %prec '.' | notype_declarator '[' expr ']' %prec '.'
{ $$ = build_nt (ARRAY_REF, $1, $3); } { $$ = build_nt (ARRAY_REF, $1, $3); }
...@@ -1346,7 +1346,7 @@ maybecomma: ...@@ -1346,7 +1346,7 @@ maybecomma:
maybecomma_warn: maybecomma_warn:
/* empty */ /* empty */
| ',' | ','
{ if (pedantic && ! flag_isoc9x) { if (pedantic && ! flag_isoc99)
pedwarn ("comma at end of enumerator list"); } pedwarn ("comma at end of enumerator list"); }
; ;
......
...@@ -403,9 +403,9 @@ extern int warn_main; ...@@ -403,9 +403,9 @@ extern int warn_main;
extern int flag_traditional; 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 /* Nonzero means to allow single precision math even if we're generally
being traditional. */ being traditional. */
......
...@@ -256,9 +256,9 @@ int traditional; ...@@ -256,9 +256,9 @@ int traditional;
int c89; 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, /* Nonzero causes output not to be done,
but directives such as #define that have side effects but directives such as #define that have side effects
...@@ -581,7 +581,7 @@ static char rest_extension[] = "..."; ...@@ -581,7 +581,7 @@ static char rest_extension[] = "...";
#define REST_EXTENSION_LENGTH (sizeof (rest_extension) - 1) #define REST_EXTENSION_LENGTH (sizeof (rest_extension) - 1)
/* This is the implicit parameter name when using variable number of /* 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__"; static char va_args_name[] = "__VA_ARGS__";
#define VA_ARGS_NAME_LENGTH (sizeof (va_args_name) - 1) #define VA_ARGS_NAME_LENGTH (sizeof (va_args_name) - 1)
...@@ -1128,8 +1128,8 @@ print_help () ...@@ -1128,8 +1128,8 @@ print_help ()
printf (" -lang-fortran Assume that the input sources are in Fortran\n"); 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 (" -lang-chill Assume that the input sources are in Chill\n");
printf (" -std=<std name> Specify the conformance standard; one of:\n"); printf (" -std=<std name> Specify the conformance standard; one of:\n");
printf (" gnu89, gnu9x, c89, c9x, iso9899:1990,\n"); printf (" gnu89, gnu99, c89, c99, iso9899:1990,\n");
printf (" iso9899:199409, iso9899:199x\n"); printf (" iso9899:199409, iso9899:1999\n");
printf (" -+ Allow parsing of C++ style features\n"); printf (" -+ Allow parsing of C++ style features\n");
printf (" -w Inhibit warning messages\n"); printf (" -w Inhibit warning messages\n");
printf (" -Wtrigraphs Warn if trigraphs are encountered\n"); printf (" -Wtrigraphs Warn if trigraphs are encountered\n");
...@@ -1445,19 +1445,19 @@ main (argc, argv) ...@@ -1445,19 +1445,19 @@ main (argc, argv)
case 'l': case 'l':
if (! strcmp (argv[i], "-lang-c")) 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")) 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; no_trigraphs = 0;
pend_defs[2*i] = "__STRICT_ANSI__"; pend_defs[2*i] = "__STRICT_ANSI__";
} }
else if (! strcmp (argv[i], "-lang-c++")) 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")) 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++")) 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")) else if (! strcmp (argv[i], "-lang-asm"))
lang_asm = 1; lang_asm = 1;
else if (! strcmp (argv[i], "-lang-fortran")) else if (! strcmp (argv[i], "-lang-fortran"))
...@@ -1473,24 +1473,24 @@ main (argc, argv) ...@@ -1473,24 +1473,24 @@ main (argc, argv)
case 's': case 's':
if (!strcmp (argv[i], "-std=gnu89")) 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") else if (!strcmp (argv[i], "-std=gnu9x")
|| !strcmp (argv[i], "-std=gnu99")) || !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"; pend_defs[2*i+1] = "__STDC_VERSION__=199901L";
} }
else if (!strcmp (argv[i], "-std=iso9899:1990") else if (!strcmp (argv[i], "-std=iso9899:1990")
|| !strcmp (argv[i], "-std=c89")) || !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; no_trigraphs = 0;
pend_defs[2*i] = "__STRICT_ANSI__"; pend_defs[2*i] = "__STRICT_ANSI__";
} }
else if (!strcmp (argv[i], "-std=iso9899:199409")) 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; no_trigraphs = 0;
pend_defs[2*i] = "__STRICT_ANSI__"; pend_defs[2*i] = "__STRICT_ANSI__";
pend_defs[2*i+1] = "__STDC_VERSION__=199409L"; pend_defs[2*i+1] = "__STDC_VERSION__=199409L";
...@@ -1500,7 +1500,7 @@ main (argc, argv) ...@@ -1500,7 +1500,7 @@ main (argc, argv)
|| !strcmp (argv[i], "-std=c9x") || !strcmp (argv[i], "-std=c9x")
|| !strcmp (argv[i], "-std=c99")) || !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; no_trigraphs = 0;
pend_defs[2*i] = "__STRICT_ANSI__"; pend_defs[2*i] = "__STRICT_ANSI__";
pend_defs[2*i+1] = "__STDC_VERSION__=199901L"; pend_defs[2*i+1] = "__STDC_VERSION__=199901L";
...@@ -5845,10 +5845,10 @@ create_definition (buf, limit, op) ...@@ -5845,10 +5845,10 @@ create_definition (buf, limit, op)
if (!is_idstart[*bp]) 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) && 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. */ number of arguments. */
rest_args = 1; rest_args = 1;
temp->rest_args = 1; temp->rest_args = 1;
...@@ -5872,7 +5872,7 @@ create_definition (buf, limit, op) ...@@ -5872,7 +5872,7 @@ create_definition (buf, limit, op)
} }
if (bp == temp->name && rest_args == 1) 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->name = (U_CHAR *) va_args_name;
temp->length = VA_ARGS_NAME_LENGTH; temp->length = VA_ARGS_NAME_LENGTH;
} }
...@@ -5891,7 +5891,7 @@ create_definition (buf, limit, op) ...@@ -5891,7 +5891,7 @@ create_definition (buf, limit, op)
SKIP_WHITE_SPACE (bp); SKIP_WHITE_SPACE (bp);
/* A comma at this point can only be followed by an identifier. */ /* A comma at this point can only be followed by an identifier. */
if (!is_idstart[*bp] 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)) { && bcmp (rest_extension, bp, REST_EXTENSION_LENGTH) == 0)) {
error ("badly punctuated parameter list in `#define'"); error ("badly punctuated parameter list in `#define'");
goto nope; goto nope;
......
...@@ -114,7 +114,7 @@ struct cpp_buffer ...@@ -114,7 +114,7 @@ struct cpp_buffer
parse_underflow_t underflow; parse_underflow_t underflow;
parse_cleanup_t cleanup; parse_cleanup_t cleanup;
void *data; void *data;
/* Value of if_stack at start of this file. /* Value of if_stack at start of this file.
Used to prohibit unmatched #endif (etc) in an include file. */ Used to prohibit unmatched #endif (etc) in an include file. */
struct if_stack *if_stack; struct if_stack *if_stack;
...@@ -185,7 +185,7 @@ struct cpp_reader ...@@ -185,7 +185,7 @@ struct cpp_reader
/* Hash table of macros and assertions. See cpphash.c */ /* Hash table of macros and assertions. See cpphash.c */
#define HASHSIZE 1403 #define HASHSIZE 1403
struct hashnode **hashtab; struct hashnode **hashtab;
/* Hash table of other included files. See cppfiles.c */ /* Hash table of other included files. See cppfiles.c */
#define ALL_INCLUDE_HASHSIZE 71 #define ALL_INCLUDE_HASHSIZE 71
struct include_hash *all_include_files[ALL_INCLUDE_HASHSIZE]; struct include_hash *all_include_files[ALL_INCLUDE_HASHSIZE];
...@@ -465,9 +465,9 @@ struct cpp_options { ...@@ -465,9 +465,9 @@ struct cpp_options {
/* Nonzero for the 1989 C Standard, including corrigenda and amendments. */ /* Nonzero for the 1989 C Standard, including corrigenda and amendments. */
char c89; char c89;
/* Nonzero for the 199x C Standard, including corrigenda and amendments. */ /* Nonzero for the 1999 C Standard, including corrigenda and amendments. */
char c9x; char c99;
/* Nonzero means give all the error messages the ANSI standard requires. */ /* Nonzero means give all the error messages the ANSI standard requires. */
char pedantic; char pedantic;
...@@ -801,9 +801,8 @@ extern struct include_hash *include_hash PARAMS ((cpp_reader *, const char *, in ...@@ -801,9 +801,8 @@ extern struct include_hash *include_hash PARAMS ((cpp_reader *, const char *, in
#define INCLUDE_LEN_FUDGE 0 #define INCLUDE_LEN_FUDGE 0
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __GCC_CPPLIB__ */ #endif /* __GCC_CPPLIB__ */
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