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
# - upgrade to PHOENIX_V3 since that is needed for c++11 compile
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
# TODO - remove when building against >= 1.55
# https://github.com/mapnik/mapnik/issues/1970
if 'clang++' in env['CXX']:
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)
if env['DEFAULT_LOG_SEVERITY']:
@ -1781,14 +1784,14 @@ if not preconfigured:
# Common flags for g++/clang++ CXX compiler.
# 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']:
env.Append(CXXFLAGS = common_cxx_flags + '-O0 -fno-inline')
env.Append(CXXFLAGS = common_cxx_flags + '-O0')
else:
# TODO - add back -fvisibility-inlines-hidden
# 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']:
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::projection const& map_proj,
std::vector<mapnik::layer> const& layers,
double scale_denom,
mapnik::box2d<double> const& map_extent)
double scale_denom)
{
unsigned layers_size = layers.size();
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_);
ren.start_map_processing(*m_);
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_);
if (!preview_.empty()) {
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_);
ren.start_map_processing(*m_);
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_);
}
}

View file

@ -194,6 +194,9 @@ private:
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) {
if (status_ == closing) {
status_ = end;
@ -237,6 +240,7 @@ private:
*y = vtx.y;
return vtx.cmd;
}
#pragma GCC diagnostic pop
template <typename Iterator>
bool fit_sleeve(Iterator itr,Iterator end, vertex2d const& v)

View file

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

View file

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

View file

@ -25,7 +25,11 @@
#include <mapnik/simplify.hpp>
// 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
#pragma GCC diagnostic pop
namespace mapnik {