Skip to content

Commit

Permalink
Suppresses gcc warnings only for boost includes.
Browse files Browse the repository at this point in the history
- gcc warnings old-style-cast and unused-parameter are suppressed for
  boost includes
  • Loading branch information
Matthias Werner authored and Matthias Werner committed Jun 21, 2019
1 parent 6a39acb commit 318847b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
7 changes: 0 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,10 @@ target_compile_options(Common INTERFACE
$<$<CXX_COMPILER_ID:GNU>:$<BUILD_INTERFACE:-Wextra>>
$<$<CXX_COMPILER_ID:GNU>:$<BUILD_INTERFACE:-Wold-style-cast>>
# $<$<CXX_COMPILER_ID:GNU>:$<BUILD_INTERFACE:-Wshadow>> # maybe too many false positives
$<$<CXX_COMPILER_ID:GNU>:-Wno-missing-braces>
$<$<CXX_COMPILER_ID:GNU>:-Wno-deprecated-declarations>
$<$<CXX_COMPILER_ID:GNU>:-Wno-ignored-attributes>
$<$<CXX_COMPILER_ID:GNU>:-Wno-unused-local-typedefs>
# Clang
$<$<CXX_COMPILER_ID:Clang>:$<BUILD_INTERFACE:-Wall>>
$<$<CXX_COMPILER_ID:Clang>:$<BUILD_INTERFACE:-Wextra>>
$<$<CXX_COMPILER_ID:Clang>:$<BUILD_INTERFACE:-Wshadow>> # see above, does better job than gcc
$<$<CXX_COMPILER_ID:Clang>:-Wno-missing-braces>
$<$<CXX_COMPILER_ID:Clang>:-Wno-deprecated-declarations>
$<$<CXX_COMPILER_ID:Clang>:-Wno-ignored-attributes>
# MSVC
$<$<CXX_COMPILER_ID:MSVC>:/bigobj>
$<$<CXX_COMPILER_ID:MSVC>:/wd4003>
Expand Down
4 changes: 4 additions & 0 deletions inc/core/application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@

#include "gearshifft_version.hpp"

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wold-style-cast"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include <boost/asio.hpp>
#pragma GCC diagnostic pop

#include <ctime>
#include <vector>
Expand Down
5 changes: 5 additions & 0 deletions inc/core/benchmark_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@
#include "types.hpp"

// http://www.boost.org/doc/libs/1_56_0/doc/html/align/tutorial.html

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wold-style-cast"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include <boost/align/aligned_allocator.hpp>
#include <boost/range/counting_range.hpp>
#include <boost/container/vector.hpp>
#include <boost/noncopyable.hpp>
#pragma GCC diagnostic pop

#include <numeric>
#include <vector>
Expand Down
4 changes: 4 additions & 0 deletions inc/core/benchmark_executor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
#include "benchmark_data.hpp"
#include "types.hpp"

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wold-style-cast"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include <boost/test/included/unit_test.hpp> // Single-header usage variant
#pragma GCC diagnostic pop

#include <type_traits>
#include <cmath>
Expand Down
3 changes: 3 additions & 0 deletions inc/core/options.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
#define OPTIONS_HPP_

#include "types.hpp"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wold-style-cast"
#include <boost/program_options.hpp>
#include <boost/core/noncopyable.hpp>
#pragma GCC diagnostic pop
#include <string>
#include <vector>

Expand Down

0 comments on commit 318847b

Please sign in to comment.