From 844642e6edf5263a44532a9c863feee7cec72261 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 27 Oct 1998 13:26:51 +0000 Subject: [PATCH] Ignore empty target specific options... Ignore empty target specific options, and if -W is also specified on the command line then display undocumented options. From-SVN: r23366 --- gcc/ChangeLog | 8 +++++++- gcc/invoke.texi | 11 ++++++++++- gcc/toplev.c | 25 ++++++++++++++++++++----- 3 files changed, 37 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d664b98475a..21a25cc259d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ +Tue Oct 27 13:15:02 1998 Nick Clifton + + * toplev.c (display_help): Ignore empty target specific + options, and if -W is also specified on the command line then + display undocumented options. + Tue Oct 27 16:11:43 1998 David Edelsohn - + * collect2.c (aix64_flag): New variable. (main, case 'b'): Parse it. (GCC_CHECK_HDR): object magic number must match mode. diff --git a/gcc/invoke.texi b/gcc/invoke.texi index 3e6356a8c25..162a1e69a4f 100644 --- a/gcc/invoke.texi +++ b/gcc/invoke.texi @@ -87,7 +87,7 @@ in the following sections. @item Overall Options @xref{Overall Options,,Options Controlling the Kind of Output}. @smallexample --c -S -E -o @var{file} -pipe -v -x @var{language} +-c -S -E -o @var{file} -pipe -v --help -x @var{language} @end smallexample @item C Language Options @@ -558,6 +558,15 @@ Use pipes rather than temporary files for communication between the various stages of compilation. This fails to work on some systems where the assembler is unable to read from a pipe; but the GNU assembler has no trouble. + +@item --help +Print (on the standard output) a description of the command line options +understood by @code{gcc}. If the @code{-v} option is also specified +then @code{--help} will also be passed on to the various processes +invoked by @code{gcc}, so that they can display the command line options +they accept. If the @code{-W} option is also specified then command +line options which have no documentation associated with them will also +be displayed. @end table @node Invoking G++ diff --git a/gcc/toplev.c b/gcc/toplev.c index 203b40e6d2f..64ef43e4301 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -4079,7 +4079,12 @@ display_help () char * option = documented_lang_options[i].option; if (description == NULL) - undoc = 1; + { + undoc = 1; + + if (extra_warnings) + printf (" %-23.23s [undocumented]\n", option); + } else if (* description == 0) continue; else if (option == NULL) @@ -4119,10 +4124,15 @@ display_help () char * option = target_switches[i].name; char * description = target_switches[i].description; - if (option == NULL) + if (option == NULL || * option == 0) continue; else if (description == NULL) - undoc = 1; + { + undoc = 1; + + if (extra_warnings) + printf (" -m%-21.21s [undocumented]\n", option); + } else if (* description != 0) doc += printf (" -m%-21.21s %s\n", option, description); } @@ -4133,10 +4143,15 @@ display_help () char * option = target_options[i].prefix; char * description = target_options[i].description; - if (option == NULL) + if (option == NULL || * option == 0) continue; else if (description == NULL) - undoc = 1; + { + undoc = 1; + + if (extra_warnings) + printf (" -m%-21.21s [undocumented]\n", option); + } else if (* description != 0) doc += printf (" -m%-21.21s %s\n", option, description); } -- 2.30.2