From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id B97BF38582BD for ; Wed, 9 Nov 2022 13:01:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B97BF38582BD Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-x630.google.com with SMTP id m22so9236523eji.10 for ; Wed, 09 Nov 2022 05:01:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=abknUYvAM7RU1EMEAreI27LOFkFsRrnd8zUG0+pLEH0=; b=fnKxJk8HdgeCoHZ1ZYEm9WMgFylogm5PVff15u0CgJ3QByNmeG9geevD/YsoKLFOIc YE8BTGeWVDs03Oo2huSMK9dNB8qSDN5r/9B69WQOHDNpxCd18PHvG6fNQ7WqI7DctYb2 r33Y1tf8XLqijIiE0ZI9B2galhmdSXFhoBGaQYXMcaA8H+caV0ToKMbWPovCk1pFm5rY fqa6HtqZ7n8r/J4avTxYSe6J3mRtuIcld+p/Gu6R1jakk1duUBwGiOhCkShZKFGQUMTf 30jxHru0KSBKe1Q6pDoGq7dytb3jehXRY8TCCnzrG+9qVWRHl0I5OdBnQtbeOV/2eQXb QV7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=abknUYvAM7RU1EMEAreI27LOFkFsRrnd8zUG0+pLEH0=; b=RDQ0nOTyqYD/cspP/sdbQp+LPLZRgCB63Nj14U7OypSC2VPBjt2u8dz+dPKAwPsP9b MPmNDjPrsudbbz92Kf2fXx0aG9aIEzo5Wxknoix0iJmZ+P/XcCruXXgIkjOurtXs6ztU lfT4nANcf6LPfY++vi635mosyKf5JE1ZjRMcQ6S4AVHzYEYXO383i+9Wi0KsroUgIY1d cMvQDtRFPCW8dRbaWxc7vu5KrM3h9q7b7KNHW8oRUuDKjkpludkecaNh1IAw2lJqWFJo dIE9RTA8Jw1xU7qaWhlBLe9BfjgskU0Qa6QerzJ/6KTSti7CUKdJAlR89Dtvx8ei7FW8 mu5g== X-Gm-Message-State: ANoB5pn2/Sw5rkW5CKPaGbcZDkCKR1Enm9czFTR5cbQNemgiWBzpdujF nwIp/6Z3/5H+Z51g9kMnqtjFPY0PjVPFlu3aCwQ= X-Google-Smtp-Source: AA0mqf4GvplJ7eLiBGr56zxGsoi+SldPGcwg43lNQhzhECei1Y40kdYx0Q+aHGSq1SreTIrcvXiiQ6OMIdQfvrm0dnE= X-Received: by 2002:a17:907:778a:b0:7ae:743c:61c1 with SMTP id ky10-20020a170907778a00b007ae743c61c1mr10300327ejc.511.1667998868123; Wed, 09 Nov 2022 05:01:08 -0800 (PST) MIME-Version: 1.0 References: <4b3c5344-171c-783e-e485-611223baf5bc@suse.cz> In-Reply-To: <4b3c5344-171c-783e-e485-611223baf5bc@suse.cz> From: Richard Biener Date: Wed, 9 Nov 2022 14:00:55 +0100 Message-ID: Subject: Re: [PATCH (pushed)] sphinx: update diagnostics URLs To: =?UTF-8?Q?Martin_Li=C5=A1ka?= Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 List-Id: On Wed, Nov 9, 2022 at 1:12 PM Martin Li=C5=A1ka wrote: > > 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=3Dcmdoption-Wfoo > > but for now, let's use the proper landing pages. Do we need a redirect at the old location? > 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=3D option. */ > if (strstr (cl_opt->opt_text, "flto")) > - return "gcc/Optimize-Options.html"; > + return "gcc/gcc-command-options/options-that-control-optimization.ht= ml"; > > #ifdef CL_Fortran > if ((cl_opt->flags & CL_Fortran) !=3D 0 > @@ -3623,10 +3623,11 @@ get_option_html_page (int option_index) > && (cl_opt->flags & CL_CXX) =3D=3D 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-warning= s.html"; > } > > /* Return malloced memory for a URL describing the option OPTION_INDEX > @@ -3645,11 +3646,8 @@ get_option_url (diagnostic_context *, int option_i= ndex) > "gcc/Warning-Options.html". */ > get_option_html_page (option_index), > > - /* Expect an anchor of the form "index-Wfoo" e.g. > - , and thus an id with= in > - 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.ht= ml"); > + 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 > } > > -- > 2.38.0 >