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 {
            ^
_______________________________________________
freebsd-toolchain@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "freebsd-toolchain-unsubscr...@freebsd.org"

Reply via email to