Ignore empty target specific options...
authorNick Clifton <nickc@cygnus.com>
Tue, 27 Oct 1998 13:26:51 +0000 (13:26 +0000)
committerNick Clifton <nickc@gcc.gnu.org>
Tue, 27 Oct 1998 13:26:51 +0000 (13:26 +0000)
Ignore empty target specific options, and if -W is also specified on the
command line then display undocumented options.

From-SVN: r23366

gcc/ChangeLog
gcc/invoke.texi
gcc/toplev.c

index d664b98475acf5c4c8e4f2116bf8e8c2e747096f..21a25cc259df586996a9909a398450012bf033ae 100644 (file)
@@ -1,5 +1,11 @@
+Tue Oct 27 13:15:02 1998  Nick Clifton  <nickc@cygnus.com>
+       
+       * 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  <edelsohn@mhpcc.edu>
-
+       
        * collect2.c (aix64_flag): New variable.
        (main, case 'b'): Parse it.
        (GCC_CHECK_HDR): object magic number must match mode.
index 3e6356a8c255129f0acc687ee9ee851225a62cdd..162a1e69a4fb2412f1688d70bbbfebb9696ad62d 100644 (file)
@@ -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++
index 203b40e6d2f85e6f37dcd0ee543877e7ec424eb7..64ef43e4301d561788b63203db8cc0d6a2496eeb 100644 (file)
@@ -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);
        }