aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@cygnus.com>1998-12-01 21:05:17 +0000
committerRichard Henderson <rth@gcc.gnu.org>1998-12-01 13:05:17 -0800
commit6f4d72224e91330c6c02d5b96b04b97e84024589 (patch)
tree8180a32dab64f00b8c46fedcdc5e7b9928102158 /gcc/gcc.c
parent8da31fc17102a9413921d73c8b15834851eba567 (diff)
downloadgcc-6f4d72224e91330c6c02d5b96b04b97e84024589.zip
gcc-6f4d72224e91330c6c02d5b96b04b97e84024589.tar.gz
gcc-6f4d72224e91330c6c02d5b96b04b97e84024589.tar.bz2
c-common.c (declare_function_name): Declare predefinied variable `__func__'.
* c-common.c (declare_function_name): Declare predefinied variable `__func__'. * c-decl.c (flag_isoc9x): Set to 1 by default. (c_decode_option): Handle -std= option. Remove -flang-isoc9x. (grokdeclarator): Always emit warning about implicit int for ISO C 9x. * c-parse.in: Allow constructors in ISO C 9x. Rewrite designator list handling. Allow [*] parameters. Don't warn about comma at end of enum definition for ISO C 9x. * cccp.c (c9x): New variable. (rest_extension): New variable. (print_help): Document new -std= option. (main): Recognize -std= option. Set c9x appropriately. (create_definition): Recognize ISO C 9x vararg macros. * gcc.c (default_compilers): Adjust specs for -std options. (option_map): Add --std. (display_help): Document -std. * toplev.c (documented_lang_options): Add -std and remove -flang-isoc9x. * c-lex.c (yylex): Recognize hex FP constants and call REAL_VALUE_ATOF or REAL_VALUE_HTOF based on base of the constants. * fold-const.c (real_hex_to_f): New function. Replacement function for hex FP conversion if REAL_ARITHMETIC is not defined. * real.c (asctoeg): Add handling of hex FP constants. * real.h: Define REAL_VALUE_HTOF if necessary using ereal_atof or real_hex_to_f. Co-Authored-By: Richard Henderson <rth@cygnus.com> Co-Authored-By: Stephen L Moshier <moshier@world.std.com> From-SVN: r24049
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c41
1 files changed, 23 insertions, 18 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 8521665..7b67bd3 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -581,12 +581,13 @@ static struct compiler default_compilers[] =
{"@c",
{
#if USE_CPPLIB
- "%{E|M|MM:cpp -lang-c%{ansi:89} %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
+ "%{E|M|MM:cpp -lang-c %(ansi:-std=c89} %{std*} %{nostdinc*}\
+ %{C} %{v} %{A*} %{I*} %{P} %I\
%{C:%{!E:%eGNU C does not support -C without using -E}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
-undef -D__GNUC__=%v1 -D__GNUC_MINOR__=%v2\
- %{ansi:-trigraphs -D__STRICT_ANSI__}\
- %{!undef:%{!ansi:%p} %P} %{trigraphs} \
+ %{ansi|std=*:%{!std=gnu:-trigraphs -D__STRICT_ANSI__}}\
+ %{!undef:%{!ansi:%{!std=*:%p}%{std=gnu:%p}} %P} %{trigraphs}\
%c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
%{traditional} %{ftraditional:-traditional}\
%{traditional-cpp:-traditional}\
@@ -594,20 +595,20 @@ static struct compiler default_compilers[] =
%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
%i %{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}}\n}\
%{!E:%{!M:%{!MM:cc1 %i %1 \
- -lang-c%{ansi:89} %{nostdinc*} %{A*} %{I*} %I\
+ %{std*} %{nostdinc*} %{A*} %{I*} %I\
%{!Q:-quiet} -dumpbase %b.c %{d*} %{m*} %{a*}\
%{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
-undef -D__GNUC__=%v1 -D__GNUC_MINOR__=%v2\
- %{ansi:-trigraphs -D__STRICT_ANSI__}\
- %{!undef:%{!ansi:%p} %P} %{trigraphs} \
+ %{ansi|std=*:%{!std=gnu:-trigraphs -D__STRICT_ANSI__}}\
+ %{!undef:%{!ansi:%{!std=*:%p}%{std=gnu:%p}} %P} %{trigraphs}\
%c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
%{H} %C %{D*} %{U*} %{i*} %Z\
%{ftraditional:-traditional}\
%{traditional-cpp:-traditional}\
%{traditional} %{v:-version} %{pg:-p} %{p} %{f*}\
%{aux-info*}\
- %{--help:--help} \
- %{g*} %{O*} %{W*} %{w} %{pedantic*} %{ansi} \
+ %{--help:--help}\
+ %{g*} %{O*} %{W*} %{w} %{pedantic*}\
%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
%{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\
%{!S:as %a %Y\
@@ -615,12 +616,13 @@ static struct compiler default_compilers[] =
%{!pipe:%g.s} %A\n }}}}"
}},
#else /* ! USE_CPPLIB */
- "cpp -lang-c%{ansi:89} %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
+ "cpp -lang-c %{ansi:-std=c89} %{std*} %{nostdinc*}\
+ %{C} %{v} %{A*} %{I*} %{P} %I\
%{C:%{!E:%eGNU C does not support -C without using -E}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
-undef -D__GNUC__=%v1 -D__GNUC_MINOR__=%v2\
- %{ansi:-trigraphs -D__STRICT_ANSI__}\
- %{!undef:%{!ansi:%p} %P} %{trigraphs} \
+ %{ansi|std=*:%{!std=gnu:-trigraphs -D__STRICT_ANSI__}}\
+ %{!undef:%{!ansi:%{!std=*:%p}%{std=gnu:%p}} %P} %{trigraphs}\
%c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
%{traditional} %{ftraditional:-traditional}\
%{traditional-cpp:-traditional}\
@@ -629,7 +631,7 @@ static struct compiler default_compilers[] =
%i %{!M:%{!MM:%{!E:%{!pipe:%g.i}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
"%{!M:%{!MM:%{!E:cc1 %{!pipe:%g.i} %1 \
%{!Q:-quiet} -dumpbase %b.c %{d*} %{m*} %{a*}\
- %{g*} %{O*} %{W*} %{w} %{pedantic*} %{ansi} \
+ %{g*} %{O*} %{W*} %{w} %{pedantic*} %{std*}\
%{traditional} %{v:-version} %{pg:-p} %{p} %{f*}\
%{aux-info*}\
%{--help:--help} \
@@ -641,12 +643,13 @@ static struct compiler default_compilers[] =
}},
#endif /* ! USE_CPPLIB */
{"-",
- {"%{E:cpp -lang-c%{ansi:89} %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
+ {"%{E:cpp -lang-c %{ansi:-std=c89} %{std*} %{nostdinc*}\
+ %{C} %{v} %{A*} %{I*} %{P} %I\
%{C:%{!E:%eGNU C does not support -C without using -E}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
-undef -D__GNUC__=%v1 -D__GNUC_MINOR__=%v2\
- %{ansi:-trigraphs -D__STRICT_ANSI__}\
- %{!undef:%{!ansi:%p} %P} %{trigraphs}\
+ %{ansi|std=*:%{!std=gnu:-trigraphs -D__STRICT_ANSI__}}\
+ %{!undef:%{!ansi:%{!std=*:%p}%{std=gnu:%p}} %P} %{trigraphs}\
%c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
%{traditional} %{ftraditional:-traditional}\
%{traditional-cpp:-traditional}\
@@ -661,8 +664,8 @@ static struct compiler default_compilers[] =
%{C:%{!E:%eGNU C does not support -C without using -E}}\
%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
-undef -D__GNUC__=%v1 -D__GNUC_MINOR__=%v2\
- %{ansi:-trigraphs -D__STRICT_ANSI__}\
- %{!undef:%{!ansi:%p} %P} %{trigraphs}\
+ %{std=*:%{!std=gnu:-trigraphs -D__STRICT_ANSI__}}\
+ %{!undef:%{!std=*:%p}%{std=gnu:%p} %P} %{trigraphs}\
%c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
%{traditional} %{ftraditional:-traditional}\
%{traditional-cpp:-traditional}\
@@ -672,7 +675,7 @@ static struct compiler default_compilers[] =
{".i", {"@cpp-output"}},
{"@cpp-output",
{"%{!M:%{!MM:%{!E:cc1 %i %1 %{!Q:-quiet} %{d*} %{m*} %{a*}\
- %{g*} %{O*} %{W*} %{w} %{pedantic*} %{ansi}\
+ %{g*} %{O*} %{W*} %{w} %{pedantic*} %{std*}\
%{traditional} %{v:-version} %{pg:-p} %{p} %{f*}\
%{aux-info*}\
%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
@@ -850,6 +853,7 @@ struct option_map option_map[] =
{"--silent", "-q", 0},
{"--specs", "-specs=", "aj"},
{"--static", "-static", 0},
+ {"--std", "-std=", "aj"},
{"--symbolic", "-symbolic", 0},
{"--target", "-b", "a"},
{"--trace-includes", "-H", 0},
@@ -2454,6 +2458,7 @@ display_help ()
printf (" -save-temps Do not delete intermediate files\n");
printf (" -pipe Use pipes rather than intermediate files\n");
printf (" -specs=<file> Override builtin specs with the contents of <file>\n");
+ printf (" -std=<standard> Assume that the input sources are for <standard>\n");
printf (" -B <directory> Add <directory> to the compiler's search paths\n");
printf (" -b <machine> Run gcc for target <machine>, if installed\n");
printf (" -V <version> Run gcc version number <version>, if installed\n");