bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: Alexandre Duret-Lutz <adl@lrde.epita.fr>
Cc: bug-gnulib@gnu.org
Subject: Re: clang++ hard failure with GNULIB_NAMESPACE
Date: Fri, 15 Jan 2021 10:51:02 +0100	[thread overview]
Message-ID: <3481842.QgHHNxatZX@omega> (raw)
In-Reply-To: <87o8hrfxbw.fsf_-_@lrde.epita.fr>

Hi Alexandre,

> 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);
> ^~~~~~~~~~~~~~~~~~~~~~~~~

On which version of glibc do you see this?

On my machine, the testdir created through
  $ ./gnulib-tool --create-testdir --dir=../testdir4 --single-configure --with-c++-tests memchr rawmemchr strchrnul

compiles fine with clang 11 and these environment variable settings:

CC=$HOME/inst-clang/11.0.0/bin/clang
CXX="$HOME/inst-clang/11.0.0/bin/clang++ -L/usr/lib/gcc/x86_64-linux-gnu/5 -I/usr/include/c++/5 -I/usr/include/x86_64-linux-gnu/c++/5"
export CC CXX

Does this same testdir work for you? If yes, can you show a small .cc file
that exhibits the problem?

If I can't reproduce it, I'll have to ask you for appropriate modifications
of gnulib/lib/string.in.h that make things for work you.

Bruno



  reply	other threads:[~2021-01-15  9:51 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     ` clang++ hard failure with GNULIB_NAMESPACE Alexandre Duret-Lutz
2021-01-15  9:51       ` Bruno Haible [this message]
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=3481842.QgHHNxatZX@omega \
    --to=bruno@clisp.org \
    --cc=adl@lrde.epita.fr \
    --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).