From: David Malcolm <dmalcolm@redhat.com>
To: Sergei Trofimovich <slyich@gmail.com>, gcc-patches@gcc.gnu.org
Cc: Sergei Trofimovich <siarheit@google.com>
Subject: Re: [PATCH] diagnostics: fix gcc-urlifier.cc bootstrap failure [PR112379]
Date: Sat, 04 Nov 2023 13:36:25 -0400 [thread overview]
Message-ID: <2098c9ef6452c81d4f13c8a3b11a93a304c8d8db.camel@redhat.com> (raw)
In-Reply-To: <20231104162318.4142088-1-slyich@gmail.com>
On Sat, 2023-11-04 at 16:23 +0000, Sergei Trofimovich wrote:
> From: Sergei Trofimovich <siarheit@google.com>
>
> Without the change `./configure --enable-checking=release` bootstrap
> fails as:
>
> gcc/gcc-urlifier.cc:100:1: error:
> 'get_url_suffix_for_quoted_text()'
> defined but not used [-Werror=unused-function]
>
> This happens because the helper is used only in `ASSERT` macros which
> don't always get expanded to executable code.
>
> The fix marks helper function with `ATTRIBUTE_UNUSED`.
Sorry for the breakage.
Patch looks good to me; thanks
Dave
>
> gcc/
> PR bootstrap/112379
> * gcc-urlifier.cc (get_url_suffix_for_quoted_text): Mark as
> ATTRIBUTE_UNUSED.
> ---
> gcc/gcc-urlifier.cc | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/gcc/gcc-urlifier.cc b/gcc/gcc-urlifier.cc
> index 269246bc703..0dbff985313 100644
> --- a/gcc/gcc-urlifier.cc
> +++ b/gcc/gcc-urlifier.cc
> @@ -37,7 +37,8 @@ public:
> char *get_url_for_quoted_text (const char *p, size_t sz) const
> final override;
>
> const char *get_url_suffix_for_quoted_text (const char *p, size_t
> sz) const;
> - const char *get_url_suffix_for_quoted_text (const char *p) const;
> + /* We use ATTRIBUTE_UNUSED as this helper is called only from
> ASSERTs. */
> + const char *get_url_suffix_for_quoted_text (const char *p) const
> ATTRIBUTE_UNUSED;
>
> private:
> static char *
prev parent reply other threads:[~2023-11-04 17:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-04 16:23 Sergei Trofimovich
2023-11-04 17:36 ` David Malcolm [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2098c9ef6452c81d4f13c8a3b11a93a304c8d8db.camel@redhat.com \
--to=dmalcolm@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=siarheit@google.com \
--cc=slyich@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).