public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin Liška" <mliska@suse.cz>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] --target-help: align with --help=target
Date: Thu, 31 Mar 2022 08:56:32 +0200	[thread overview]
Message-ID: <ccb1bfcc-74a4-5ec6-7916-60a94b815ead@suse.cz> (raw)

Hi.

Before the patch we have:

$ gcc-11 --help | grep target-help
   --target-help            Display target specific command line options.
$ gcc-11 --help=common | grep target-help
   --target-help               Alias for --help=target.

and --target-help prints undocumented options (that was reported in the PR).

After my change we do:

$ gcc --help | grep target-help
   --target-help            Display target specific command line options (including assembler and linker options).
$ gcc --help=common | grep target-help
   --target-help               Display target specific command line options (including assembler and linker options).

and the undocumented options are not printed.

Ready to be installed after tests?
Thanks,
Martin

	PR driver/105096

gcc/ChangeLog:

	* common.opt: Document properly based on what it does.
	* gcc.cc (display_help): Unify with what we have in common.opt.
	* opts.cc (common_handle_option): Do not print undocumented
	options.
---
  gcc/common.opt | 2 +-
  gcc/gcc.cc     | 3 ++-
  gcc/opts.cc    | 2 +-
  3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/gcc/common.opt b/gcc/common.opt
index 8b6513de47c..8a0dafc522d 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -419,7 +419,7 @@ Driver Alias(symbolic)
  
  -target-help
  Common Driver
-Alias for --help=target.
+Display target specific command line options (including assembler and linker options).
  
  -time
  Driver Alias(time)
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index a4d863ca457..bb07cc244e3 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -3758,7 +3758,8 @@ display_help (void)
  
    fputs (_("  -pass-exit-codes         Exit with highest error code from a phase.\n"), stdout);
    fputs (_("  --help                   Display this information.\n"), stdout);
-  fputs (_("  --target-help            Display target specific command line options.\n"), stdout);
+  fputs (_("  --target-help            Display target specific command line options "
+	   "(including assembler and linker options).\n"), stdout);
    fputs (_("  --help={common|optimizers|params|target|warnings|[^]{joined|separate|undocumented}}[,...].\n"), stdout);
    fputs (_("                           Display specific types of command line options.\n"), stdout);
    if (! verbose_flag)
diff --git a/gcc/opts.cc b/gcc/opts.cc
index ef5fe9b11ca..e5e3119a980 100644
--- a/gcc/opts.cc
+++ b/gcc/opts.cc
@@ -2557,7 +2557,7 @@ common_handle_option (struct gcc_options *opts,
  	break;
  
        target_option_override_hook ();
-      print_specific_help (CL_TARGET, CL_UNDOCUMENTED, 0, opts, lang_mask);
+      print_specific_help (CL_TARGET, 0, 0, opts, lang_mask);
        opts->x_exit_after_options = true;
        break;
  
-- 
2.35.1


             reply	other threads:[~2022-03-31  6:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-31  6:56 Martin Liška [this message]
2022-04-06 15:27 ` Jeff Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ccb1bfcc-74a4-5ec6-7916-60a94b815ead@suse.cz \
    --to=mliska@suse.cz \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).