diff options
author | Sergei Trofimovich <siarheit@google.com> | 2023-11-04 16:18:02 +0000 |
---|---|---|
committer | Sergei Trofimovich <siarheit@google.com> | 2023-11-04 18:21:54 +0000 |
commit | 9eef85a0276a0a118b76ce2da00861b75e9a3012 (patch) | |
tree | dcf7fb3d7db00dacbc08a80c04712d3f3247ee62 /gcc/gcc-urlifier.cc | |
parent | ada871cfadd3f4960b4435f6f7f07a5aca1887d3 (diff) | |
download | gcc-9eef85a0276a0a118b76ce2da00861b75e9a3012.zip gcc-9eef85a0276a0a118b76ce2da00861b75e9a3012.tar.gz gcc-9eef85a0276a0a118b76ce2da00861b75e9a3012.tar.bz2 |
diagnostics: fix gcc-urlifier.cc bootstrap failure [PR112379]
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`.
gcc/
PR bootstrap/112379
* gcc-urlifier.cc (get_url_suffix_for_quoted_text): Mark as
ATTRIBUTE_UNUSED.
Diffstat (limited to 'gcc/gcc-urlifier.cc')
-rw-r--r-- | gcc/gcc-urlifier.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/gcc-urlifier.cc b/gcc/gcc-urlifier.cc index 269246b..0dbff98 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 * |