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: 17522 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp297488wru; Wed, 9 Nov 2022 04:12:38 -0800 (PST) X-Google-Smtp-Source: AMsMyM55JxilWaq2Mbu3b05/aAjMpuHXPAvdGq1NTAcHZf8woqXvn1SkfJnFa+E6Yi9qcBB6cTJG X-Received: by 2002:aa7:c9c7:0:b0:463:4eff:a07 with SMTP id i7-20020aa7c9c7000000b004634eff0a07mr50764003edt.88.1667995958202; Wed, 09 Nov 2022 04:12:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667995958; cv=none; d=google.com; s=arc-20160816; b=BVR/5jDNSZJZAYnJ5P8Lfcn+cB6MNEaJKcg+GVlximS95ai9rxRmhkugnLmlrvoNpm zTG4BMq7DdcftRHbC9xKQvZ5w5+QZD8htL7NI9VlxO080H+zOGM0oGsGgUFmYOtVxFSW G8j07xIaAYOJXAi5/djxUQf7cb0v11UxlYnRY1Nt+MHjKf6p63fiqh5Eu9WPkoJnQ9Ld D661YS2P0M8W9CoyitP/g3ZEuTYiYVBvPDPGTNzrmIPgmQyPMBgY5WURHWhLTFHn++zw vnAYSeSqkL9M+cvK4gC6aJDsprb04TYnBVN9fVNfr6tDm+2vhx8/nD/gtLXtRXq0fDPX W9BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :content-language:to:subject:from:user-agent:mime-version:date :message-id:dkim-signature:dkim-signature:dmarc-filter:delivered-to; bh=2gaormBGaXutthcSOTq93Tfj28VM60ZqrRGrUxJTrL0=; b=zUqmYiuDkThfnnf8AO84m0+XGnhdUEbfgGKQsCP0bjpFdbv1TUKwD9zwGVx/teTOV0 zSSVDtPsWBFO2qR4ufCAQ+COiF8o1xMh3JP7AYC818sVPAfuVggZzMF78BqOKg2q2DQX c926JmvuVFvtZpLXiIfbWkSC9gfuc7WVFDKkzta2F7Hs9ZxMa09M+ZFaHsvmV6QxsAxB sBKJccSLxt5UwsxRof7cyy2LspoZg6CkLMpFwSBkOm1vbFTRQMm1apiCEAKUdlTIfEIm n/6Sbd+BBBLGvd1L55qgw6guthpFs2NSeR9dzmQzatKfbiHQtydw2b/FfNlDTyJ96ZyU fV+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=gxWJdaZD; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=gHfwVJdg; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id r2-20020aa7da02000000b00461c9bb5205si13688405eds.152.2022.11.09.04.12.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 04:12:38 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=gxWJdaZD; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=gHfwVJdg; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 005DF38438A3 for ; Wed, 9 Nov 2022 12:12:32 +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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749020529818685985?= X-GMAIL-MSGID: =?utf-8?q?1749020529818685985?= 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 }