From patchwork Thu Mar 31 06:56:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 52495 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E063E383942B for ; Thu, 31 Mar 2022 06:56:51 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 10C463858C50 for ; Thu, 31 Mar 2022 06:56:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 10C463858C50 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 8A28E1F7AB; Thu, 31 Mar 2022 06:56:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1648709793; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=56QfDMuHRnxXbnrHvTymHdzaBM9rWtZ357L22J5ikmE=; b=SmuCv18MnjDuuMwA0a/UTCSrUrXIu5dj4amKPJa7EAxlug0g/QoJAm48afRLqLUL8hIjkF 54Pu9u7GSt87BEby9au+6xTTUBnUTMRn2JXLGVFJwZmmzkHymdDn5XgJZgcrUW00qxvmUm cn8e3D2lufSiDEIytThWbuyMUrsfZus= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1648709793; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=56QfDMuHRnxXbnrHvTymHdzaBM9rWtZ357L22J5ikmE=; b=YDA4syMp8CGOy8iBCIfPvMfudOPfNFZyz1pSnhjJy0Y1/cpvPBf+S3u0CFc07KzeA5OhA8 L5Sqd1t5+Jy8iAAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 773BF139C2; Thu, 31 Mar 2022 06:56:33 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 6+3wG6FQRWJkUwAAMHmgww (envelope-from ); Thu, 31 Mar 2022 06:56:33 +0000 Message-ID: Date: Thu, 31 Mar 2022 08:56:32 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH] --target-help: align with --help=target To: gcc-patches@gcc.gnu.org Content-Language: en-US X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" 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;