Skip to content

Commit c8a0535

Browse files
committed
Propagated CXXFLAGS.
Fixed warnings.
1 parent 71687c4 commit c8a0535

File tree

5 files changed

+35
-3
lines changed

5 files changed

+35
-3
lines changed

ci/build_cmake.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ else
2626
export ARCH_FLAG="-m64"
2727
fi
2828

29-
cmake -DMSGPACK_CXX11=${CXX11} -DMSGPACK_CXX17=${CXX17} -DMSGPACK_32BIT=${BIT32} -DMSGPACK_CHAR_SIGN=${CHAR_SIGN} -DMSGPACK_DEFAULT_API_VERSION=${API_VERSION} -DMSGPACK_USE_X3_PARSE=${X3_PARSE} -DCMAKE_CXX_FLAGS=${ARCH_FLAG} ${ZLIB32} -fsanitize=undefined ..
29+
cmake -DMSGPACK_CXX11=${CXX11} -DMSGPACK_CXX17=${CXX17} -DMSGPACK_32BIT=${BIT32} -DMSGPACK_CHAR_SIGN=${CHAR_SIGN} -DMSGPACK_DEFAULT_API_VERSION=${API_VERSION} -DMSGPACK_USE_X3_PARSE=${X3_PARSE} -DCMAKE_CXX_FLAGS="${ARCH_FLAG} ${CXXFLAGS} -fsanitize=undefined" ${ZLIB32} ..
3030

3131
ret=$?
3232
if [ $ret -ne 0 ]

include/msgpack/v1/adaptor/boost/fusion.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,23 @@
2121
#include "msgpack/adaptor/cpp11/tuple.hpp"
2222
#endif // #if !defined (MSGPACK_USE_CPP03)
2323

24+
#if defined(__GNUC__)
25+
#pragma GCC diagnostic push
26+
#pragma GCC diagnostic ignored "-Wconversion"
27+
#endif // defined(__GNUC__)
28+
2429
#include <boost/fusion/support/is_sequence.hpp>
2530
#include <boost/fusion/sequence/intrinsic/size.hpp>
2631
#include <boost/fusion/algorithm/iteration/for_each.hpp>
2732
#include <boost/fusion/sequence/intrinsic/at.hpp>
2833
#include <boost/fusion/include/mpl.hpp>
34+
35+
36+
#if defined(__GNUC__)
37+
#pragma GCC diagnostic pop
38+
#endif // defined(__GNUC__)
39+
40+
2941
#include <boost/mpl/size.hpp>
3042

3143
namespace msgpack {

include/msgpack/v1/adaptor/boost/msgpack_variant.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,18 @@
2626
#include "msgpack/adaptor/vector.hpp"
2727
#include "msgpack/adaptor/map.hpp"
2828

29+
30+
#if defined(__GNUC__)
31+
#pragma GCC diagnostic push
32+
#pragma GCC diagnostic ignored "-Wconversion"
33+
#endif // defined(__GNUC__)
34+
2935
#include <boost/variant.hpp>
36+
37+
#if defined(__GNUC__)
38+
#pragma GCC diagnostic pop
39+
#endif // defined(__GNUC__)
40+
3041
#include <boost/operators.hpp>
3142

3243
namespace msgpack {

include/msgpack/v1/adaptor/boost/optional.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
#include "msgpack/adaptor/adaptor_base.hpp"
1515
#include "msgpack/adaptor/check_container_size.hpp"
1616

17+
#if defined(__GNUC__)
18+
#pragma GCC diagnostic push
19+
#pragma GCC diagnostic ignored "-Wconversion"
20+
#endif // defined(__GNUC__)
21+
1722
// To suppress warning on Boost.1.58.0
1823
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) || defined(__clang__)
1924
#pragma GCC diagnostic push
@@ -26,6 +31,10 @@
2631
#pragma GCC diagnostic pop
2732
#endif // defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) || defined(__clang__)
2833

34+
#if defined(__GNUC__)
35+
#pragma GCC diagnostic pop
36+
#endif // defined(__GNUC__)
37+
2938
namespace msgpack {
3039

3140
/// @cond

test/msgpack_cpp11.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,7 +1461,7 @@ TEST(MSGPACK_TIMESPEC, timespec_object_with_zone_zero)
14611461
TEST(MSGPACK_TIMESPEC, timespec_pack_convert_32bit_sec)
14621462
{
14631463
std::stringstream ss;
1464-
timespec val1{ std::numeric_limits<decltype(std::declval<timespec>().tv_sec)>::is_signed ? INT32_MAX : UINT32_MAX, 0 };
1464+
timespec val1{ std::numeric_limits<decltype(std::declval<timespec>().tv_sec)>::is_signed ? time_t(INT32_MAX) : time_t(UINT32_MAX), 0 };
14651465

14661466
msgpack::pack(ss, val1);
14671467
std::string const& str = ss.str();
@@ -1477,7 +1477,7 @@ TEST(MSGPACK_TIMESPEC, timespec_pack_convert_32bit_sec)
14771477
TEST(MSGPACK_TIMESPEC, timespec_object_with_zone_32bit_sec)
14781478
{
14791479
msgpack::zone z;
1480-
timespec val1{ std::numeric_limits<decltype(std::declval<timespec>().tv_sec)>::is_signed ? INT32_MAX : UINT32_MAX, 0 };
1480+
timespec val1{ std::numeric_limits<decltype(std::declval<timespec>().tv_sec)>::is_signed ? time_t(INT32_MAX) : time_t(UINT32_MAX), 0 };
14811481
msgpack::object obj(val1, z);
14821482
timespec val2 = obj.as<timespec>();
14831483
EXPECT_EQ(val1.tv_sec, val2.tv_sec);

0 commit comments

Comments
 (0)