From fa29cf0c3f19b648e30b16fd2485c3c17a528a6e Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 5 Dec 2019 14:47:35 -0500 Subject: Fix warning URLs for Fortran and analyzer [PR 92830] PR 92830 reports that we always use "gcc/Warning-Options.html" when we emit escaped documentation URLs when printing "[-Wname-of-option]" for a warning. This page is wrong for most Fortran warnings, and for analyzer warnings. I considered various schemes involving adding extra tags to the .opt format to capture where options are documented, but for now this patch fixes the issue by introducing some special-casing logic. It only fixes the URLs for warning options, not for other command-line options, but those are the only options for which get_option_url is currently called. gcc/ChangeLog: PR 92830 * configure.ac (DOCUMENTATION_ROOT_URL): Drop trailing "gcc/" from default value, so that it can by supplied by get_option_html_page. * configure: Regenerate. * opts.c: Include "selftest.h". (get_option_html_page): New function. (get_option_url): Use it. Reformat to place comments next to the expressions they refer to. (selftest::test_get_option_html_page): New. (selftest::opts_c_tests): New. * selftest-run-tests.c (selftest::run_tests): Call selftest::opts_c_tests. * selftest.h (selftest::opts_c_tests): New decl. --- gcc/selftest.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/selftest.h') diff --git a/gcc/selftest.h b/gcc/selftest.h index df98e0b..5cffa13 100644 --- a/gcc/selftest.h +++ b/gcc/selftest.h @@ -243,6 +243,7 @@ extern void input_c_tests (); extern void json_cc_tests (); extern void opt_problem_cc_tests (); extern void optinfo_emit_json_cc_tests (); +extern void opts_c_tests (); extern void ordered_hash_map_tests_cc_tests (); extern void predict_c_tests (); extern void pretty_print_c_tests (); -- cgit v1.1