Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Aug 2016 12:14:26 +0200
From:      Willem Jan Withagen <wjw@digiware.nl>
To:        FreeBSD Toolchain <freebsd-toolchain@freebsd.org>
Subject:   name conflict after upgrade to HEAD.
Message-ID:  <0777433b-66fd-7a16-c8b5-25f6fee7ad31@digiware.nl>

next in thread | raw e-mail | index | archive | help
Hi,

While compile Ceph source code I run into this conflict of the usuage of
'log'

Now I've fixed it by prefixing the log with ::log on line 845.
Which works for me, but I'm pretty sure that that is not the best solution.

Why is this al of a sudden a problem?
The log namespace has been in Ceph for a long time.

The original namespace block looks like:
namespace ceph {
  class PluginRegistry;
  class HeartbeatMap;
  namespace log {
    class Log;
  }
}

So where does this conflict come from?

--WjW

This is FreeBSD Revision: 304572
and clang:
FreeBSD clang version 3.8.0 (tags/RELEASE_380/final 262564) (based on
LLVM 3.8.0)
Target: x86_64-unknown-freebsd12.0
Thread model: posix
InstalledDir: /usr/bin


In file included from /usr/include/c++/v1/cmath:301:
/usr/include/c++/v1/math.h:845:37: error: reference to 'log' is ambiguous
log(_A1 __lcpp_x) _NOEXCEPT {return log((double)__lcpp_x);}
                                    ^
/usr/include/c++/v1/math.h:845:1: note: candidate found by name lookup
is 'log'
log(_A1 __lcpp_x) _NOEXCEPT {return log((double)__lcpp_x);}
^
/usr/include/c++/v1/math.h:839:46: note: candidate found by name lookup
is 'log'
inline _LIBCPP_INLINE_VISIBILITY long double log(long double __lcpp_x)
_NOEXCEPT {return logl(__lcpp_x);}
                                             ^
/usr/include/c++/v1/math.h:838:46: note: candidate found by name lookup
is 'log'
inline _LIBCPP_INLINE_VISIBILITY float       log(float __lcpp_x)
_NOEXCEPT       {return logf(__lcpp_x);}
                                             ^
/usr/include/math.h:247:8: note: candidate found by name lookup is 'log'
double  log(double);
        ^
/home/wjw/ceph/src/common/ceph_context.h:44:13: note: candidate found by
name lookup is 'ceph::log'
  namespace log {
            ^



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0777433b-66fd-7a16-c8b5-25f6fee7ad31>