diagnostics: don't generate URLs that won't be used
authorDavid Malcolm <dmalcolm@redhat.com>
Tue, 4 Feb 2020 00:58:54 +0000 (19:58 -0500)
committerDavid Malcolm <dmalcolm@redhat.com>
Tue, 18 Feb 2020 01:40:00 +0000 (20:40 -0500)
commitabb4852434b3dee26301cc406472ac9450c621aa
tree9f6d5a947e9fc0982fdee66d899b1d4b5777e202
parentd8cde6f9c223f1b6d4f4e4e07088f08a629b7c2a
diagnostics: don't generate URLs that won't be used

The two places in diagnostics.c where URLs are printed both do
non-trivial work to generate the URL strings (including malloc/free), so
don't do this work if URL-printing is disabled.

gcc/ChangeLog:
* diagnostic.c (print_any_cwe): Don't call get_cwe_url if URLs
won't be printed.
(print_option_information): Don't call get_option_url if URLs
won't be printed.
gcc/ChangeLog
gcc/diagnostic.c