silence more warnings

This commit is contained in:
Dane Springmeyer 2014-10-21 17:44:47 -07:00
parent 87192bfcb7
commit d25f0c316a
6 changed files with 28 additions and 10 deletions

View file

@ -1736,11 +1736,14 @@ if not preconfigured:
# c++11 support / https://github.com/mapnik/mapnik/issues/1683 # c++11 support / https://github.com/mapnik/mapnik/issues/1683
# - upgrade to PHOENIX_V3 since that is needed for c++11 compile # - upgrade to PHOENIX_V3 since that is needed for c++11 compile
env.Append(CPPDEFINES = '-DBOOST_SPIRIT_USE_PHOENIX_V3=1') env.Append(CPPDEFINES = '-DBOOST_SPIRIT_USE_PHOENIX_V3=1')
if 'clang++' in env['CXX']:
env.Append(CXXFLAGS = '-Wno-unknown-pragmas')
# - workaround boost gil channel_algorithm.hpp narrowing error # - workaround boost gil channel_algorithm.hpp narrowing error
# TODO - remove when building against >= 1.55 # TODO - remove when building against >= 1.55
# https://github.com/mapnik/mapnik/issues/1970 # https://github.com/mapnik/mapnik/issues/1970
if 'clang++' in env['CXX']:
env.Append(CXXFLAGS = '-Wno-c++11-narrowing') env.Append(CXXFLAGS = '-Wno-c++11-narrowing')
if 'g++' in env['CXX']:
env.Append(CXXFLAGS = '-Wno-pragmas')
# Enable logging in debug mode (always) and release mode (when specified) # Enable logging in debug mode (always) and release mode (when specified)
if env['DEFAULT_LOG_SEVERITY']: if env['DEFAULT_LOG_SEVERITY']:
@ -1781,14 +1784,14 @@ if not preconfigured:
# Common flags for g++/clang++ CXX compiler. # Common flags for g++/clang++ CXX compiler.
# TODO: clean up code more to make -Wsign-conversion -Wconversion -Wshadow viable # TODO: clean up code more to make -Wsign-conversion -Wconversion -Wshadow viable
common_cxx_flags = '-Wall -Wsign-compare %s %s -ftemplate-depth-300 ' % (env['WARNING_CXXFLAGS'], pthread) common_cxx_flags = '-Wall -Wsign-compare -Wextra %s %s -ftemplate-depth-300 ' % (env['WARNING_CXXFLAGS'], pthread)
if env['DEBUG']: if env['DEBUG']:
env.Append(CXXFLAGS = common_cxx_flags + '-O0 -fno-inline') env.Append(CXXFLAGS = common_cxx_flags + '-O0')
else: else:
# TODO - add back -fvisibility-inlines-hidden # TODO - add back -fvisibility-inlines-hidden
# https://github.com/mapnik/mapnik/issues/1863 # https://github.com/mapnik/mapnik/issues/1863
env.Append(CXXFLAGS = common_cxx_flags + '-O%s -Wextra -Wno-unknown-pragmas' % (env['OPTIMIZATION'])) env.Append(CXXFLAGS = common_cxx_flags + '-O%s' % (env['OPTIMIZATION']))
if env['DEBUG_UNDEFINED']: if env['DEBUG_UNDEFINED']:
env.Append(CXXFLAGS = '-fsanitize=undefined-trap -fsanitize-undefined-trap-on-error -ftrapv -fwrapv') env.Append(CXXFLAGS = '-fsanitize=undefined-trap -fsanitize-undefined-trap-on-error -ftrapv -fwrapv')

View file

@ -17,8 +17,7 @@ template <typename Renderer> void process_layers(Renderer & ren,
mapnik::request const& m_req, mapnik::request const& m_req,
mapnik::projection const& map_proj, mapnik::projection const& map_proj,
std::vector<mapnik::layer> const& layers, std::vector<mapnik::layer> const& layers,
double scale_denom, double scale_denom)
mapnik::box2d<double> const& map_extent)
{ {
unsigned layers_size = layers.size(); unsigned layers_size = layers.size();
for (unsigned i=0; i < layers_size; ++i) for (unsigned i=0; i < layers_size; ++i)
@ -100,7 +99,7 @@ public:
mapnik::agg_renderer<mapnik::image_32> ren(*m_,m_req,variables,im,scale_factor_); mapnik::agg_renderer<mapnik::image_32> ren(*m_,m_req,variables,im,scale_factor_);
ren.start_map_processing(*m_); ren.start_map_processing(*m_);
std::vector<mapnik::layer> const& layers = m_->layers(); std::vector<mapnik::layer> const& layers = m_->layers();
process_layers(ren,m_req,map_proj,layers,scale_denom,extent_); process_layers(ren,m_req,map_proj,layers,scale_denom);
ren.end_map_processing(*m_); ren.end_map_processing(*m_);
if (!preview_.empty()) { if (!preview_.empty()) {
std::clog << "preview available at " << preview_ << "\n"; std::clog << "preview available at " << preview_ << "\n";
@ -124,7 +123,7 @@ public:
mapnik::agg_renderer<mapnik::image_32> ren(*m_,m_req,variables,im,scale_factor_); mapnik::agg_renderer<mapnik::image_32> ren(*m_,m_req,variables,im,scale_factor_);
ren.start_map_processing(*m_); ren.start_map_processing(*m_);
std::vector<mapnik::layer> const& layers = m_->layers(); std::vector<mapnik::layer> const& layers = m_->layers();
process_layers(ren,m_req,map_proj,layers,scale_denom,extent_); process_layers(ren,m_req,map_proj,layers,scale_denom);
ren.end_map_processing(*m_); ren.end_map_processing(*m_);
} }
} }

View file

@ -194,6 +194,9 @@ private:
return previous_vertex_.cmd; return previous_vertex_.cmd;
} }
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
unsigned output_vertex_distance(double* x, double* y) { unsigned output_vertex_distance(double* x, double* y) {
if (status_ == closing) { if (status_ == closing) {
status_ = end; status_ = end;
@ -237,6 +240,7 @@ private:
*y = vtx.y; *y = vtx.y;
return vtx.cmd; return vtx.cmd;
} }
#pragma GCC diagnostic pop
template <typename Iterator> template <typename Iterator>
bool fit_sleeve(Iterator itr,Iterator end, vertex2d const& v) bool fit_sleeve(Iterator itr,Iterator end, vertex2d const& v)

View file

@ -28,10 +28,14 @@
#include <mapnik/feature_factory.hpp> #include <mapnik/feature_factory.hpp>
// boost // boost
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wunused-local-typedef"
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#ifdef SHAPE_MEMORY_MAPPED_FILE #ifdef SHAPE_MEMORY_MAPPED_FILE
#include <boost/interprocess/streams/bufferstream.hpp> #include <boost/interprocess/streams/bufferstream.hpp>
#endif #endif
#pragma GCC diagnostic pop
#include "shape_index_featureset.hpp" #include "shape_index_featureset.hpp"
#include "shape_utils.hpp" #include "shape_utils.hpp"

View file

@ -34,8 +34,12 @@
#include <mapnik/util/fs.hpp> #include <mapnik/util/fs.hpp>
// boost // boost
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wunused-local-typedef"
#include <boost/assert.hpp> #include <boost/assert.hpp>
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#pragma GCC diagnostic pop
// agg // agg
#include "agg_rendering_buffer.h" #include "agg_rendering_buffer.h"

View file

@ -25,7 +25,11 @@
#include <mapnik/simplify.hpp> #include <mapnik/simplify.hpp>
// boost // boost
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wunused-local-typedef"
#include <boost/algorithm/string/replace.hpp> // for replace #include <boost/algorithm/string/replace.hpp> // for replace
#pragma GCC diagnostic pop
namespace mapnik { namespace mapnik {