From 916269abda5db96aa0d939d61ec1a2c9addd2728 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 29 Jan 2000 19:00:43 +0000 Subject: [PATCH] Adjust variable names, comments, help strings to c99. Recognize options with names *99 as well. From-SVN: r31690 --- gcc/c-decl.c | 28 +++++++++++++++------------- gcc/cppinit.c | 29 +++++++++++++++-------------- 2 files changed, 30 insertions(+), 27 deletions(-) diff --git a/gcc/c-decl.c b/gcc/c-decl.c index cc072a680d9..864ea8bbf56 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -324,9 +324,9 @@ int flag_no_nonansi_builtin; 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 @@ c_decode_option (argc, argv) 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 @@ c_decode_option (argc, argv) 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 @@ c_decode_option (argc, argv) 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 @@ c_decode_option (argc, argv) 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 +3917,12 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) && ! (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); } diff --git a/gcc/cppinit.c b/gcc/cppinit.c index 2ee6e78d9cd..e8f4d88609d 100644 --- a/gcc/cppinit.c +++ b/gcc/cppinit.c @@ -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 @@ cpp_handle_option (pfile, argc, argv) 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 @@ cpp_handle_option (pfile, argc, argv) 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 @@ cpp_handle_option (pfile, argc, argv) || !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 @@ Switches:\n\ -lang-fortran Assume that the input sources are in Fortran\n\ -lang-chill Assume that the input sources are in Chill\n\ -std= 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\ -- 2.30.2