Fix compiler warnings.

Switch of compiler warnings for part of the code.
The compiler flag -Weffc++ of the gcc compiler creates many warnings about non virtual destructor of base classes where the
base class is actually a class from boost or from stl. Switch of the compiler flag for the problematic parts of the code
using preprocessor statements. There are also such preprocessor guards for code which creates many warnings when
using clang.

Filter warnings comming from generated files.
When using CTest all warnings comming from generated code (Root Dictionaries, code generated by protoc) will be filtered
before sending the results to the CDash web server.

Remove unused variables or use them.
Initialize all data members in initializer lists.
Use in initializer list the same order of data members as defined in the class declaration.
Declare private copy constructors and assignment operators where needed.

Fix format problems in printf statements.
Correctly cast the variables.
This commit is contained in:
Florian Uhlig
2016-03-17 13:19:49 +01:00
parent fa7040fe65
commit 4ca66e33da
5 changed files with 26 additions and 1 deletions

View File

@@ -14,6 +14,7 @@
#ifndef LOGGER_H
#define LOGGER_H
#define BOOST_LOG_DYN_LINK 1 // necessary when linking the boost_log library dynamically
#define FUSION_MAX_VECTOR_SIZE 20
@@ -81,12 +82,21 @@ void set_global_log_level( log_op::operation op=log_op::GREATER_EQ_THAN,
custom_severity_level threshold=SEVERITY_THRESHOLD );
void set_global_log_level_operation( log_op::operation op=log_op::GREATER_EQ_THAN,
custom_severity_level threshold=SEVERITY_THRESHOLD );
#if defined(__GNUC__) || defined(__GNUG__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#endif
// register a global logger (declaration)
BOOST_LOG_GLOBAL_LOGGER(global_logger, boost::log::sources::severity_logger_mt<custom_severity_level>)
BOOST_LOG_ATTRIBUTE_KEYWORD(fairmq_logger_timestamp, "TimeStamp", boost::posix_time::ptime)
BOOST_LOG_ATTRIBUTE_KEYWORD(severity, "Severity", custom_severity_level)
#if defined(__GNUC__) || defined(__GNUG__)
#pragma GCC diagnostic pop
#endif
template<typename T>
void init_log_formatter(const boost::log::record_view &view, boost::log::formatting_ostream &os)