bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Alexandre Duret-Lutz <adl@lrde.epita.fr>
To: Bruno Haible <bruno@clisp.org>
Cc: bug-gnulib@gnu.org
Subject: clang++ hard failure with GNULIB_NAMESPACE
Date: Thu, 14 Jan 2021 14:43:31 +0100	[thread overview]
Message-ID: <87o8hrfxbw.fsf_-_@lrde.epita.fr> (raw)
In-Reply-To: <87eein6c2b.fsf@lrde.epita.fr> (Alexandre Duret-Lutz's message of "Thu, 14 Jan 2021 11:35:24 +0100")

Alexandre Duret-Lutz <adl@lrde.epita.fr> writes:

> Bruno Haible <bruno@clisp.org> writes:
>
>> in C++, it is easier and more robust to define GNULIB_NAMESPACE.
>
> OK, thanks, I'll progress this way.

Progress is not smooth.  This time it's unrelated to -Werror.

Using clang++ 11, compilation fails because of the overloads of memchr
and friends.  Note that clang++11 defines __GNUC__ and __GNU_MINOR__ as
4 and 2 (Yuck!) so the two _GL_CXXALIASWARN1 calls dealing with the two
overloads in lib/string.h are not performed.

In file included from bitvect.cc:28:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/cstring:42:
../../lib/string.h:693:1: error: reference to overloaded function could not be resolved; did you mean to call it?
_GL_CXXALIASWARN (memchr);
^~~~~~~~~~~~~~~~~~~~~~~~~
../../lib/wchar.h:382:4: note: expanded from macro '_GL_CXXALIASWARN'
   _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../lib/wchar.h:384:4: note: expanded from macro '_GL_CXXALIASWARN_1'
   _GL_CXXALIASWARN_2 (func, namespace)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../lib/wchar.h:389:5: note: expanded from macro '_GL_CXXALIASWARN_2'
    _GL_WARN_ON_USE (func, \
    ^~~~~~~~~~~~~~~~~~~~~~~~
../../lib/wchar.h:552:19: note: expanded from macro '_GL_WARN_ON_USE'
extern __typeof__ (function) function \
                  ^~~~~~~~~~
/usr/include/string.h:84:1: note: possible target for call
memchr (const void *__s, int __c, size_t __n) __THROW
^
/usr/include/string.h:78:1: note: possible target for call
memchr (void *__s, int __c, size_t __n) __THROW
^
In file included from bitvect.cc:28:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/cstring:42:
../../lib/string.h:807:1: error: reference to overloaded function could not be resolved; did you mean to call it?
_GL_CXXALIASWARN (rawmemchr);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../lib/wchar.h:382:4: note: expanded from macro '_GL_CXXALIASWARN'
   _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../lib/wchar.h:384:4: note: expanded from macro '_GL_CXXALIASWARN_1'
   _GL_CXXALIASWARN_2 (func, namespace)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../lib/wchar.h:389:5: note: expanded from macro '_GL_CXXALIASWARN_2'
    _GL_WARN_ON_USE (func, \
    ^~~~~~~~~~~~~~~~~~~~~~~~
../../lib/wchar.h:552:19: note: expanded from macro '_GL_WARN_ON_USE'
extern __typeof__ (function) function \
                  ^~~~~~~~~~
/usr/include/string.h:101:26: note: possible target for call
extern "C++" const void *rawmemchr (const void *__s, int __c)
                         ^
/usr/include/string.h:99:20: note: possible target for call
extern "C++" void *rawmemchr (void *__s, int __c)
                   ^
In file included from bitvect.cc:28:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/cstring:42:
../../lib/string.h:911:1: error: reference to overloaded function could not be resolved; did you mean to call it?
_GL_CXXALIASWARN (strchrnul);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../lib/wchar.h:382:4: note: expanded from macro '_GL_CXXALIASWARN'
   _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../lib/wchar.h:384:4: note: expanded from macro '_GL_CXXALIASWARN_1'
   _GL_CXXALIASWARN_2 (func, namespace)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../lib/wchar.h:389:5: note: expanded from macro '_GL_CXXALIASWARN_2'
    _GL_WARN_ON_USE (func, \
    ^~~~~~~~~~~~~~~~~~~~~~~~
../../lib/wchar.h:552:19: note: expanded from macro '_GL_WARN_ON_USE'
extern __typeof__ (function) function \
                  ^~~~~~~~~~
/usr/include/string.h:263:26: note: possible target for call
extern "C++" const char *strchrnul (const char *__s, int __c)
                         ^
/usr/include/string.h:261:20: note: possible target for call
extern "C++" char *strchrnul (char *__s, int __c)
                   ^
3 errors generated.
make[3]: *** [Makefile:1445: bitvect.lo] Error 1
make[2]: *** [Makefile:1549: all-recursive] Error 1
make[1]: *** [Makefile:1424: all-recursive] Error 1
make: *** [Makefile:1344: all] Error 2

-- 
Alexandre Duret-Lutz


  reply	other threads:[~2021-01-14 13:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13 16:54 cannot figure out how to work with GNULIB_NAMESPACE without warnings Alexandre Duret-Lutz
2021-01-14  0:58 ` Bruno Haible
2021-01-14 10:35   ` Alexandre Duret-Lutz
2021-01-14 13:43     ` Alexandre Duret-Lutz [this message]
2021-01-15  9:51       ` clang++ hard failure with GNULIB_NAMESPACE Bruno Haible
2021-01-15 12:19         ` Alexandre Duret-Lutz

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

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o8hrfxbw.fsf_-_@lrde.epita.fr \
    --to=adl@lrde.epita.fr \
    --cc=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    /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).