Opened 9 years ago
Closed 9 years ago
#8811 closed Bugs (wontfix)
Problem compiling Boost.Log tutorial
Reported by: | Owned by: | Andrey Semashev | |
---|---|---|---|
Milestone: | To Be Determined | Component: | log |
Version: | Boost 1.54.0 | Severity: | Problem |
Keywords: | Cc: |
Description
I am using Boost.Log from Boost 1.54.0 on Fedora 18 using gcc. When I compile the trivial logging with filters tutorial using the compiler options -Wall -Wextra -Werror, it fails to compile. (Note: The generated error messages can be found in the attached file.) It successfully compiles if I add -Wno-missing-field-initializers but I would prefer not having to add that option and have clean compiles.
Attachments (1)
Change History (3)
by , 9 years ago
Attachment: | boost_log_problem.txt added |
---|
comment:1 by , 9 years ago
Im also experiencing similar warnings:
.../include/boost/log/expressions/formatters/stream.hpp:40:29: warning: missing initializer for member boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<boost::phoenix::argument<2> >, 0l> >::proto_expr_ [-Wmissing-field-initializers] const stream_type stream = {}; ^
.../include/boost/log/expressions/keyword.hpp:203:53: warning: missing initializer for member boost::log::v2_mt_posix::expressions::attribute_keyword<boost::log::v2_mt_posix::trivial::tag::severity>::proto_expr_ [-Wmissing-field-initializers] const BOOST_PP_CAT(keyword_, _type) keyword_ = {}; ^
.../include/boost/log/expressions/message.hpp:98:31: warning: missing initializer for member boost::log::v2_mt_posix::expressions::attribute_keyword<boost::log::v2_mt_posix::expressions::tag::message>::proto_expr_ [-Wmissing-field-initializers] const message_type message = {}; ^
.../include/boost/log/expressions/message.hpp:108:33: warning: missing initializer for member boost::log::v2_mt_posix::expressions::attribute_keyword<boost::log::v2_mt_posix::expressions::tag::smessage>::proto_expr_ [-Wmissing-field-initializers] const smessage_type smessage = {}; ^
.../include/boost/log/expressions/message.hpp:119:33: warning: missing initializer for member boost::log::v2_mt_posix::expressions::attribute_keyword<boost::log::v2_mt_posix::expressions::tag::wmessage>::proto_expr_ [-Wmissing-field-initializers] const wmessage_type wmessage = {}; ^
comment:2 by , 9 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
I do not see how this warning could be worked around. In C++11 it is possible to write:
const message_type message = { { {} } };
but in C++03 mode the compiler emits error on this code. Another solution is:
const message_type message = { { tag::message() } };
but this is no longer a constant initialization, which technically makes the code that uses keywords invalid.
And no matter what I do, I cannot get rid of these warnings:
./boost/log/expressions/message.hpp:98:20: error: ‘boost::log::v2s_mt_posix::expressions::message’ defined but not used [-Werror=unused-variable] ./boost/log/expressions/message.hpp:108:21: error: ‘boost::log::v2s_mt_posix::expressions::smessage’ defined but not used [-Werror=unused-variable] ./boost/log/expressions/message.hpp:119:21: error: ‘boost::log::v2s_mt_posix::expressions::wmessage’ defined but not used [-Werror=unused-variable]
Bottom line: use more reasonable warning levels with your compiler or at least disable bogus warnings like this.
Error messages from the compiler