Open abclogin opened 8 years ago
Actually it's the same error as in #126. Check again please, I've updated the PR.
Yes. It is fixed.
Other error:
/usr/home/username/bh126/src/formatter/string.cpp:193:27: error: no member named
'pthread_getname_np' in the global namespace
const auto rc = ::pthread_getname_np(record.tid(), buffer.data()...
~~^
Full log:
Scanning dependencies of target blackhole
[ 2%] Building CXX object CMakeFiles/blackhole.dir/src/config/json.cpp.o
In file included from /usr/home/username/bh126/src/config/json.cpp:8:
In file included from /usr/home/username/bh126/include/blackhole/detail/config/json.hpp:5:
In file included from /usr/local/include/boost/lexical_cast.hpp:159:
In file included from /usr/local/include/boost/numeric/conversion/cast.hpp:33:
In file included from /usr/local/include/boost/numeric/conversion/converter.hpp:14:
/usr/local/include/boost/numeric/conversion/converter_policies.hpp:139:39: warning:
dynamic exception specifications are deprecated [-Wdeprecated]
virtual const char * what() const throw()
^~~~~~~
/usr/local/include/boost/numeric/conversion/converter_policies.hpp:139:39: note:
use 'noexcept' instead
virtual const char * what() const throw()
^~~~~~~
noexcept
/usr/local/include/boost/numeric/conversion/converter_policies.hpp:147:39: warning:
dynamic exception specifications are deprecated [-Wdeprecated]
virtual const char * what() const throw()
^~~~~~~
/usr/local/include/boost/numeric/conversion/converter_policies.hpp:147:39: note:
use 'noexcept' instead
virtual const char * what() const throw()
^~~~~~~
noexcept
/usr/local/include/boost/numeric/conversion/converter_policies.hpp:154:39: warning:
dynamic exception specifications are deprecated [-Wdeprecated]
virtual const char * what() const throw()
^~~~~~~
/usr/local/include/boost/numeric/conversion/converter_policies.hpp:154:39: note:
use 'noexcept' instead
virtual const char * what() const throw()
^~~~~~~
noexcept
In file included from /usr/home/username/bh126/src/config/json.cpp:8:
In file included from /usr/home/username/bh126/include/blackhole/detail/config/json.hpp:5:
In file included from /usr/local/include/boost/lexical_cast.hpp:169:
In file included from /usr/local/include/boost/range/iterator_range_core.hpp:31:
In file included from /usr/local/include/boost/range/algorithm/equal.hpp:14:
In file included from /usr/local/include/boost/range/concepts.hpp:19:
/usr/local/include/boost/concept_check.hpp:883:8: warning: extra ';' after
member function definition [-Wextra-semi]
};
^
In file included from /usr/home/username/bh126/src/config/json.cpp:8:
In file included from /usr/home/username/bh126/include/blackhole/detail/config/json.hpp:5:
In file included from /usr/local/include/boost/lexical_cast.hpp:169:
/usr/local/include/boost/range/iterator_range_core.hpp:637:20: warning:
parameter 'Range' not found in the function declaration [-Wdocumentation]
\param Range An input range
^~~~~
/usr/local/include/boost/range/iterator_range_core.hpp:637:20: note: did you
mean 'r'?
\param Range An input range
^~~~~
r
In file included from /usr/home/username/bh126/src/config/json.cpp:8:
In file included from /usr/home/username/bh126/include/blackhole/detail/config/json.hpp:5:
In file included from /usr/local/include/boost/lexical_cast.hpp:170:
/usr/local/include/boost/container/container_fwd.hpp:160:5: warning: unknown
command tag name [-Wdocumentation-unknown-command]
/// @cond
^
In file included from /usr/home/username/bh126/src/config/json.cpp:8:
In file included from /usr/home/username/bh126/include/blackhole/detail/config/json.hpp:5:
/usr/local/include/boost/lexical_cast.hpp:1707:50: warning: implicit conversion
changes signedness: 'long' to 'size_t' (aka 'unsigned long')
[-Wsign-conversion]
end = begin + swprintf(begin, end-begin,
~~~~~~~~ ~~~^~~~~~
/usr/local/include/boost/lexical_cast.hpp:1717:50: warning: implicit conversion
changes signedness: 'long' to 'size_t' (aka 'unsigned long')
[-Wsign-conversion]
end = begin + swprintf(begin, end-begin,
~~~~~~~~ ~~~^~~~~~
/usr/local/include/boost/lexical_cast.hpp:1725:50: warning: implicit conversion
changes signedness: 'long' to 'size_t' (aka 'unsigned long')
[-Wsign-conversion]
end = begin + swprintf(begin, end-begin,
~~~~~~~~ ~~~^~~~~~
In file included from /usr/home/username/bh126/src/config/json.cpp:8:
/usr/home/username/bh126/include/blackhole/detail/config/json.hpp:185:52: warning:
will never be executed [-Wunreachable-code]
throw config::type_mismatch(cursor.empty() ? "/" : cursor, expec...
^
/usr/home/username/bh126/src/config/json.cpp:34:36: warning: unused parameter 'other'
[-Wunused-parameter]
factory<json_t>::factory(factory&& other) noexcept = default;
^
/usr/home/username/bh126/src/config/json.cpp:38:43: warning: unused parameter 'other'
[-Wunused-parameter]
auto factory<json_t>::operator=(factory&& other) noexcept -> factory& = default;
^
In file included from /usr/home/username/bh126/src/config/json.cpp:8:
In file included from /usr/home/username/bh126/include/blackhole/detail/config/json.hpp:5:
In file included from /usr/local/include/boost/lexical_cast.hpp:168:
/usr/local/include/boost/math/special_functions/fpclassify.hpp:168:18: warning:
comparing floating point with == or != is unsafe [-Wfloat-equal]
return (at != 0) ? FP_SUBNORMAL : FP_ZERO;
~~ ^ ~
/usr/local/include/boost/math/special_functions/fpclassify.hpp:250:32: note: in
instantiation of function template specialization
'boost::math::detail::fpclassify_imp<long double>' requested here
return boost::math::detail::fpclassify_imp(t, generic_tag<true>());
^
/usr/local/include/boost/math/special_functions/fpclassify.hpp:445:20: warning:
comparing floating point with == or != is unsafe [-Wfloat-equal]
&& ( x == std::numeric_limits<T>::infinity()
~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/boost/math/special_functions/fpclassify.hpp:489:32: note: in
instantiation of function template specialization
'boost::math::detail::isinf_impl<long double>' requested here
return boost::math::detail::isinf_impl(t, generic_tag<true>());
^
/usr/local/include/boost/math/special_functions/fpclassify.hpp:446:23: warning:
comparing floating point with == or != is unsafe [-Wfloat-equal]
|| x == -std::numeric_limits<T>::infinity());
~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/home/username/bh126/src/config/json.cpp:8:
In file included from /usr/home/username/bh126/include/blackhole/detail/config/json.hpp:5:
/usr/local/include/boost/lexical_cast.hpp:126:17: warning: definition of
implicit copy constructor for 'bad_lexical_cast' is deprecated because it
has a user-declared destructor [-Wdeprecated]
virtual ~bad_lexical_cast() BOOST_NOEXCEPT
^
/usr/local/include/boost/lexical_cast.hpp:2375:19: note: in instantiation of
function template specialization
'boost::throw_exception<boost::bad_lexical_cast>' requested here
BOOST_LCAST_THROW_BAD_CAST(Source, Target);
^
/usr/local/include/boost/lexical_cast.hpp:69:5: note: expanded from macro
'BOOST_LCAST_THROW_BAD_CAST'
throw_exception(bad_lexical_cast(typeid(Source), typeid(Target)))
^
/usr/local/include/boost/lexical_cast.hpp:2543:29: note: in instantiation of
member function
'boost::detail::lexical_cast_do_cast<std::__1::basic_string<char>,
unsigned long>::lexical_cast_impl' requested here
return caster_type::lexical_cast_impl(arg);
^
/usr/home/username/bh126/include/blackhole/detail/config/json.hpp:177:38: note: in
instantiation of function template specialization
'boost::lexical_cast<std::__1::basic_string<char>, unsigned long>'
requested here
return cursor + "/" + boost::lexical_cast<std::string>(idx);
^
/usr/local/include/boost/exception/exception.hpp:320:9: note: implicit copy
constructor for 'bad_lexical_cast' first required here
error_info_injector:
^
16 warnings generated.
[ 5%] Building CXX object CMakeFiles/blackhole.dir/src/config/node.cpp.o
[ 8%] Building CXX object CMakeFiles/blackhole.dir/src/config/option.cpp.o
[ 11%] Building CXX object CMakeFiles/blackhole.dir/src/datetime/generator.linux.cpp.o
[ 14%] Building CXX object CMakeFiles/blackhole.dir/src/datetime/generator.other.cpp.o
[ 17%] Building CXX object CMakeFiles/blackhole.dir/src/format.cpp.o
[ 20%] Building CXX object CMakeFiles/blackhole.dir/src/formatter/json.cpp.o
In file included from /usr/home/username/bh126/src/formatter/json.cpp:24:
In file included from /usr/home/username/bh126/include/blackhole/detail/attribute.hpp:3:
In file included from /usr/local/include/boost/variant/variant.hpp:32:
/usr/local/include/boost/variant/detail/forced_return.hpp:53:1: warning:
function 'forced_return<void>' could be declared with attribute 'noreturn'
[-Wmissing-noreturn]
{
^
/usr/home/username/bh126/src/formatter/json.cpp:205:7: warning: '__APPLE__' is not
defined, evaluates to 0 [-Wundef]
#elif __APPLE__
^
2 warnings generated.
[ 23%] Building CXX object CMakeFiles/blackhole.dir/src/formatter/mod.cpp.o
[ 26%] Building CXX object CMakeFiles/blackhole.dir/src/formatter/string.cpp.o
In file included from /usr/home/username/bh126/src/formatter/string.cpp:1:
/usr/home/username/bh126/include/blackhole/formatter/string.hpp:54:6: warning:
'\param' command used in a comment that is not attached to a function
declaration [-Wdocumentation]
/// \param severity an integer representation of current log severity.
^~~~~
/usr/home/username/bh126/include/blackhole/formatter/string.hpp:55:6: warning:
'\param' command used in a comment that is not attached to a function
declaration [-Wdocumentation]
/// \param spec the format specification as it was provided with the ini...
^~~~~
/usr/home/username/bh126/include/blackhole/formatter/string.hpp:56:6: warning:
'\param' command used in a comment that is not attached to a function
declaration [-Wdocumentation]
/// \param writer result writer.
^~~~~
In file included from /usr/home/username/bh126/src/formatter/string.cpp:8:
In file included from /usr/local/include/boost/variant/variant.hpp:32:
/usr/local/include/boost/variant/detail/forced_return.hpp:53:1: warning:
function 'forced_return<void>' could be declared with attribute 'noreturn'
[-Wmissing-noreturn]
{
^
/usr/home/username/bh126/src/formatter/string.cpp:186:7: warning: '__APPLE__' is not
defined, evaluates to 0 [-Wundef]
#elif __APPLE__
^
/usr/home/username/bh126/src/formatter/string.cpp:179:43: warning: unused parameter
'token' [-Wunused-parameter]
auto operator()(const ph::thread<id>& token) const -> void {
^
/usr/home/username/bh126/src/formatter/string.cpp:179:64: warning: function
'operator()' could be declared with attribute 'noreturn'
[-Wmissing-noreturn]
auto operator()(const ph::thread<id>& token) const -> void {
^
/usr/home/username/bh126/src/formatter/string.cpp:183:44: warning: unused parameter
'token' [-Wunused-parameter]
auto operator()(const ph::thread<hex>& token) const -> void {
^
/usr/home/username/bh126/src/formatter/string.cpp:193:27: error: no member named
'pthread_getname_np' in the global namespace
const auto rc = ::pthread_getname_np(record.tid(), buffer.data()...
~~^
8 warnings and 1 error generated.
*** Error code 1
Stop.
make[2]: stopped in /usr/home/username/bh126
*** Error code 1
Stop.
make[1]: stopped in /usr/home/username/bh126
*** Error code 1
Stop.
make: stopped in /usr/home/username/bh126
Well, this may be tricky. I'm not sure of FreeBSD pthread support, because this function is not portable at all.
Can you just try to add #include <pthread.h>
at top of "src/formatter/string.cpp"?
Can you just try to add #include
at top of "src/formatter/string.cpp"?
I did it. Same error.
I found: FreeBSD contains pthread support in standard libc. But FreeBSD contains not pthread_getname_np: https://www.gnu.org/software/gnulib/manual/html_node/pthread_005fgetname_005fnp.html
http://www.mzan.com/article/2369738-can-i-set-the-name-of-a-thread-in-pthreads-linux.shtml
#include <pthread.h>
// or <pthread_np.h> ?
// Linux, NetBSD:
int pthread_getname_np(pthread_t th, char *buf, size_t len);
// some implementations don't have a safe buffer (see MKS/IBM below)
int pthread_getname_np(pthread_t thread, const char **name);
int pthread_getname_np(pthread_t thread, char *name);
// FreeBSD & OpenBSD: dont' seem to have getname/get_name equivalent?
// but I'd imagine there's some other mechanism to read it directly for say gdb
// Mac OS X:
int pthread_getname_np(pthread_t, char*, size_t);
FreeBSD contains pthread_set_name_np function only:
#include <pthread.h> // or maybe <pthread_np.h> for some OSes
// Linux
int pthread_setname_np(pthread_t thread, const char *name);
// NetBSD: name + arg work like printf(name, arg)
int pthread_setname_np(pthread_t thread, const char *name, void *arg);
// FreeBSD & OpenBSD: function name is slightly different, and has no return value
void pthread_set_name_np(pthread_t tid, const char *name);
// Mac OS X: must be set from within the thread (can't specify thread ID)
int pthread_setname_np(const char*);
Is there anything with similar functionality?
LLDB (from LLVM) use the workaround for FreeBSD:
It is used here: https://github.com/freebsd/freebsd/blob/af3e10e5a78d3af8cef6088748978c6c612757f0/contrib/llvm/tools/lldb/source/Host/freebsd/ThisThread.cpp
It is implemented here: https://github.com/freebsd/freebsd/blob/af3e10e5a78d3af8cef6088748978c6c612757f0/contrib/llvm/tools/lldb/source/Host/freebsd/HostThreadFreeBSD.cpp
Okay, it takes significant time for me to configure FreeBSD virtual machine to be able to declare its support. Since, PR's are welcome, you can speedup the process.
Could not complile under FreeBSD 10.3, Clang 3.4.1, Boost 1.55 Branch issue/126/fix-long-long-upgrade New error is:
Full log