From patchwork Wed Nov 9 12:12:05 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: 60267 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 6DABE383EC59 for ; Wed, 9 Nov 2022 12:12:24 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id EF2BF3858D20 for ; Wed, 9 Nov 2022 12:12:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EF2BF3858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=fail 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-out1.suse.de (Postfix) with ESMTPS id C9D98226A9 for ; Wed, 9 Nov 2022 12:12:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1667995925; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2gaormBGaXutthcSOTq93Tfj28VM60ZqrRGrUxJTrL0=; b=gxWJdaZDq4qZWm+JURuA2aU1UxN0ietL+sor84JqccBQLOmNEZ/WH17Xbl7dPsj/1b7Enx Jj2FGMH6WfGIf02/eNukDGZOxl9VAfWrQz1s3WO0TFbZ78oMcXQr9ZYxijQKFq7kLzeJcL OY9W0gunbBKTOCtTlxza9Km0TttUJ9k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1667995925; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2gaormBGaXutthcSOTq93Tfj28VM60ZqrRGrUxJTrL0=; b=gHfwVJdgI595KNCkKEMAakXJdnXZhEYs+513pwfbpA2/1viG/RktG6npnvR6ksbDeG2rP0 Aeeyc145HKV7iAAg== 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 B8F15139F1 for ; Wed, 9 Nov 2022 12:12:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id uJHjKhWZa2O6VQAAMHmgww (envelope-from ) for ; Wed, 09 Nov 2022 12:12:05 +0000 Message-ID: <4b3c5344-171c-783e-e485-611223baf5bc@suse.cz> Date: Wed, 9 Nov 2022 13:12:05 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH (pushed)] sphinx: update diagnostics URLs To: gcc-patches@gcc.gnu.org Content-Language: en-US X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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" For the future, we'll use https://pypi.org/project/sphinx-redirect-by-id/ which will allow links like https://gcc.gnu.org/onlinedocs/gcc/redirect.html?q=cmdoption-Wfoo but for now, let's use the proper landing pages. Martin gcc/ChangeLog: * opts.cc (get_option_html_page): Port to sphinx URLs. (get_option_url): Likewise. (test_get_option_html_page): Likewise. --- gcc/opts.cc | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/gcc/opts.cc b/gcc/opts.cc index 3797784c865..c00887ae76e 100644 --- a/gcc/opts.cc +++ b/gcc/opts.cc @@ -3608,11 +3608,11 @@ get_option_html_page (int option_index) /* Analyzer options are on their own page. */ if (strstr (cl_opt->opt_text, "analyzer-")) - return "gcc/Static-Analyzer-Options.html"; + return "gcc/gcc-command-options/options-that-control-static-analysis.html"; /* Handle -flto= option. */ if (strstr (cl_opt->opt_text, "flto")) - return "gcc/Optimize-Options.html"; + return "gcc/gcc-command-options/options-that-control-optimization.html"; #ifdef CL_Fortran if ((cl_opt->flags & CL_Fortran) != 0 @@ -3623,10 +3623,11 @@ get_option_html_page (int option_index) && (cl_opt->flags & CL_CXX) == 0 #endif ) - return "gfortran/Error-and-Warning-Options.html"; + return ("gfortran/gnu-fortran-command-options/" + "options-to-request-or-suppress-errors-and-warnings.html"); #endif - return "gcc/Warning-Options.html"; + return "gcc/gcc-command-options/options-to-request-or-suppress-warnings.html"; } /* Return malloced memory for a URL describing the option OPTION_INDEX @@ -3645,11 +3646,8 @@ get_option_url (diagnostic_context *, int option_index) "gcc/Warning-Options.html". */ get_option_html_page (option_index), - /* Expect an anchor of the form "index-Wfoo" e.g. - , and thus an id within - the URL of "#index-Wformat". */ - "#index", cl_options[option_index].opt_text, - NULL); + /* Expect an anchor of the form "cmdoption-Wfoo". */ + "#cmdoption", cl_options[option_index].opt_text, NULL); else return NULL; } @@ -3786,12 +3784,16 @@ namespace selftest { static void test_get_option_html_page () { - ASSERT_STREQ (get_option_html_page (OPT_Wcpp), "gcc/Warning-Options.html"); + ASSERT_STREQ (get_option_html_page (OPT_Wcpp), + "gcc/gcc-command-options/" + "options-to-request-or-suppress-warnings.html"); ASSERT_STREQ (get_option_html_page (OPT_Wanalyzer_double_free), - "gcc/Static-Analyzer-Options.html"); + "gcc/gcc-command-options/" + "options-that-control-static-analysis.html"); #ifdef CL_Fortran ASSERT_STREQ (get_option_html_page (OPT_Wline_truncation), - "gfortran/Error-and-Warning-Options.html"); + "gfortran/gnu-fortran-command-options/" + "options-to-request-or-suppress-errors-and-warnings.html"); #endif }