mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-06-25 22:15:23 +02:00
Merge pull request #897 from redboltz/re_enable_werror
Propagated CXXFLAGS.
This commit is contained in:
commit
eb1e7e6e07
18
.github/workflows/gha.yml
vendored
18
.github/workflows/gha.yml
vendored
@ -41,6 +41,7 @@ jobs:
|
|||||||
export ARCH="64"
|
export ARCH="64"
|
||||||
export CHAR_SIGN="unsigned"
|
export CHAR_SIGN="unsigned"
|
||||||
export API_VERSION="1"
|
export API_VERSION="1"
|
||||||
|
export SANITIZE="-fsanitize=undefined"
|
||||||
fi
|
fi
|
||||||
if [ ${{ matrix.pattern }} == 1 ]; then
|
if [ ${{ matrix.pattern }} == 1 ]; then
|
||||||
ACTION="ci/build_cmake.sh"
|
ACTION="ci/build_cmake.sh"
|
||||||
@ -48,6 +49,7 @@ jobs:
|
|||||||
export ARCH="64"
|
export ARCH="64"
|
||||||
export CHAR_SIGN="signed"
|
export CHAR_SIGN="signed"
|
||||||
export API_VERSION="3"
|
export API_VERSION="3"
|
||||||
|
export SANITIZE="-fsanitize=undefined"
|
||||||
fi
|
fi
|
||||||
if [ ${{ matrix.pattern }} == 2 ]; then
|
if [ ${{ matrix.pattern }} == 2 ]; then
|
||||||
ACTION="ci/build_cmake.sh"
|
ACTION="ci/build_cmake.sh"
|
||||||
@ -55,12 +57,14 @@ jobs:
|
|||||||
export ARCH="64"
|
export ARCH="64"
|
||||||
export CHAR_SIGN="signed"
|
export CHAR_SIGN="signed"
|
||||||
export API_VERSION="2"
|
export API_VERSION="2"
|
||||||
|
export SANITIZE="-fsanitize=undefined"
|
||||||
fi
|
fi
|
||||||
if [ ${{ matrix.pattern }} == 3 ]; then
|
if [ ${{ matrix.pattern }} == 3 ]; then
|
||||||
ACTION="ci/build_cmake.sh"
|
ACTION="ci/build_cmake.sh"
|
||||||
export ARCH="64"
|
export ARCH="64"
|
||||||
export CHAR_SIGN="unsigned"
|
export CHAR_SIGN="unsigned"
|
||||||
export API_VERSION="2"
|
export API_VERSION="2"
|
||||||
|
export SANITIZE="-fsanitize=undefined"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# install gtest
|
# install gtest
|
||||||
@ -78,7 +82,7 @@ jobs:
|
|||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# build and test
|
# build and test
|
||||||
CMAKE_CXX_COMPILER="${CXX}" CMAKE_LIBRARY_PATH="${BASE}/usr/lib:${BASE}/build" GTEST_ROOT="${BASE}/usr" CMAKE_PREFIX_PATH="${BASE}/usr/clang/lib${ARCH}/cmake" CXXFLAGS="-Werror -g" ${ACTION}
|
CMAKE_CXX_COMPILER="${CXX}" CMAKE_LIBRARY_PATH="${BASE}/usr/lib:${BASE}/build" GTEST_ROOT="${BASE}/usr" CMAKE_PREFIX_PATH="${BASE}/usr/clang/lib${ARCH}/cmake" CXXFLAGS="-Werror -g ${SANITIZE}" ${ACTION}
|
||||||
cat Files.cmake| grep ".*\.[h|hpp]" | perl -pe 's/ //g' | sort > tmp1 && find include -name "*.h" -o -name "*.hpp" | sort > tmp2 && diff tmp1 tmp2
|
cat Files.cmake| grep ".*\.[h|hpp]" | perl -pe 's/ //g' | sort > tmp1 && find include -name "*.h" -o -name "*.hpp" | sort > tmp2 && diff tmp1 tmp2
|
||||||
|
|
||||||
linux:
|
linux:
|
||||||
@ -114,6 +118,7 @@ jobs:
|
|||||||
export ARCH="64"
|
export ARCH="64"
|
||||||
export CHAR_SIGN="unsigned"
|
export CHAR_SIGN="unsigned"
|
||||||
export API_VERSION="2"
|
export API_VERSION="2"
|
||||||
|
export SANITIZE="-fsanitize=undefined"
|
||||||
fi
|
fi
|
||||||
if [ ${{ matrix.pattern }} == 1 ]; then
|
if [ ${{ matrix.pattern }} == 1 ]; then
|
||||||
export CXX=clang++
|
export CXX=clang++
|
||||||
@ -121,6 +126,7 @@ jobs:
|
|||||||
export ARCH="32"
|
export ARCH="32"
|
||||||
export CHAR_SIGN="signed"
|
export CHAR_SIGN="signed"
|
||||||
export API_VERSION="2"
|
export API_VERSION="2"
|
||||||
|
export SANITIZE="-fsanitize=undefined"
|
||||||
fi
|
fi
|
||||||
if [ ${{ matrix.pattern }} == 2 ]; then
|
if [ ${{ matrix.pattern }} == 2 ]; then
|
||||||
export CXX=clang++
|
export CXX=clang++
|
||||||
@ -130,6 +136,7 @@ jobs:
|
|||||||
export CHAR_SIGN="signed"
|
export CHAR_SIGN="signed"
|
||||||
export API_VERSION="3"
|
export API_VERSION="3"
|
||||||
export X3_PARSE="ON"
|
export X3_PARSE="ON"
|
||||||
|
export SANITIZE="-fsanitize=undefined"
|
||||||
fi
|
fi
|
||||||
if [ ${{ matrix.pattern }} == 3 ]; then
|
if [ ${{ matrix.pattern }} == 3 ]; then
|
||||||
export CXX=clang++
|
export CXX=clang++
|
||||||
@ -146,6 +153,7 @@ jobs:
|
|||||||
export ARCH="64"
|
export ARCH="64"
|
||||||
export CHAR_SIGN="signed"
|
export CHAR_SIGN="signed"
|
||||||
export API_VERSION="2"
|
export API_VERSION="2"
|
||||||
|
export SANITIZE="-fsanitize=undefined"
|
||||||
fi
|
fi
|
||||||
if [ ${{ matrix.pattern }} == 5 ]; then
|
if [ ${{ matrix.pattern }} == 5 ]; then
|
||||||
export CXX=g++
|
export CXX=g++
|
||||||
@ -155,6 +163,7 @@ jobs:
|
|||||||
export CHAR_SIGN="unsigned"
|
export CHAR_SIGN="unsigned"
|
||||||
export API_VERSION="3"
|
export API_VERSION="3"
|
||||||
export X3_PARSE="ON"
|
export X3_PARSE="ON"
|
||||||
|
export SANITIZE="-fsanitize=undefined"
|
||||||
fi
|
fi
|
||||||
if [ ${{ matrix.pattern }} == 6 ]; then
|
if [ ${{ matrix.pattern }} == 6 ]; then
|
||||||
export CXX=g++
|
export CXX=g++
|
||||||
@ -162,6 +171,7 @@ jobs:
|
|||||||
export ARCH="64"
|
export ARCH="64"
|
||||||
export CHAR_SIGN="unsigned"
|
export CHAR_SIGN="unsigned"
|
||||||
export API_VERSION="2"
|
export API_VERSION="2"
|
||||||
|
export SANITIZE="-fsanitize=undefined"
|
||||||
fi
|
fi
|
||||||
if [ ${{ matrix.pattern }} == 7 ]; then
|
if [ ${{ matrix.pattern }} == 7 ]; then
|
||||||
export CXX=g++
|
export CXX=g++
|
||||||
@ -169,6 +179,7 @@ jobs:
|
|||||||
export ARCH="32"
|
export ARCH="32"
|
||||||
export CHAR_SIGN="signed"
|
export CHAR_SIGN="signed"
|
||||||
export API_VERSION="1"
|
export API_VERSION="1"
|
||||||
|
export SANITIZE="-fsanitize=undefined"
|
||||||
fi
|
fi
|
||||||
if [ ${{ matrix.pattern }} == 8 ]; then
|
if [ ${{ matrix.pattern }} == 8 ]; then
|
||||||
export CXX=g++
|
export CXX=g++
|
||||||
@ -176,6 +187,7 @@ jobs:
|
|||||||
export ARCH="32"
|
export ARCH="32"
|
||||||
export CHAR_SIGN="signed"
|
export CHAR_SIGN="signed"
|
||||||
export API_VERSION="2"
|
export API_VERSION="2"
|
||||||
|
export SANITIZE="-fsanitize=undefined"
|
||||||
fi
|
fi
|
||||||
if [ ${{ matrix.pattern }} == 9 ]; then
|
if [ ${{ matrix.pattern }} == 9 ]; then
|
||||||
export CXX=clang++
|
export CXX=clang++
|
||||||
@ -184,6 +196,7 @@ jobs:
|
|||||||
export SAN="UBSAN"
|
export SAN="UBSAN"
|
||||||
export MSGPACK_FUZZ_REGRESSION="ON"
|
export MSGPACK_FUZZ_REGRESSION="ON"
|
||||||
export CTEST_OUTPUT_ON_FAILURE=1
|
export CTEST_OUTPUT_ON_FAILURE=1
|
||||||
|
export SANITIZE="-fsanitize=undefined"
|
||||||
fi
|
fi
|
||||||
if [ ${{ matrix.pattern }} == 10 ]; then
|
if [ ${{ matrix.pattern }} == 10 ]; then
|
||||||
export CXX=clang++
|
export CXX=clang++
|
||||||
@ -192,6 +205,7 @@ jobs:
|
|||||||
export SAN="ASAN"
|
export SAN="ASAN"
|
||||||
export MSGPACK_FUZZ_REGRESSION="ON"
|
export MSGPACK_FUZZ_REGRESSION="ON"
|
||||||
export CTEST_OUTPUT_ON_FAILURE=1
|
export CTEST_OUTPUT_ON_FAILURE=1
|
||||||
|
export SANITIZE="-fsanitize=undefined"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# install gtest
|
# install gtest
|
||||||
@ -214,7 +228,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# build and test
|
# build and test
|
||||||
CMAKE_CXX_COMPILER="${CXX}" CMAKE_LIBRARY_PATH="${BASE}/usr/lib:${BASE}/build" GTEST_ROOT="${BASE}/usr" CMAKE_PREFIX_PATH="${BASE}/usr/gcc/lib${ARCH}/cmake" CXXFLAGS="-Werror -g" MSGPACK_SAN="${SAN}" ${ACTION}
|
CMAKE_CXX_COMPILER="${CXX}" CMAKE_LIBRARY_PATH="${BASE}/usr/lib:${BASE}/build" GTEST_ROOT="${BASE}/usr" CMAKE_PREFIX_PATH="${BASE}/usr/gcc/lib${ARCH}/cmake" CXXFLAGS="-Werror -g ${SANITIZE}" MSGPACK_SAN="${SAN}" ${ACTION}
|
||||||
cat Files.cmake| grep ".*\.[h|hpp]" | perl -pe 's/ //g' | sort > tmp1 && find include -name "*.h" -o -name "*.hpp" | sort > tmp2 && diff tmp1 tmp2
|
cat Files.cmake| grep ".*\.[h|hpp]" | perl -pe 's/ //g' | sort > tmp1 && find include -name "*.h" -o -name "*.hpp" | sort > tmp2 && diff tmp1 tmp2
|
||||||
windows:
|
windows:
|
||||||
runs-on: windows-2016
|
runs-on: windows-2016
|
||||||
|
@ -26,7 +26,7 @@ else
|
|||||||
export ARCH_FLAG="-m64"
|
export ARCH_FLAG="-m64"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
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 ..
|
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}" ${ZLIB32} ..
|
||||||
|
|
||||||
ret=$?
|
ret=$?
|
||||||
if [ $ret -ne 0 ]
|
if [ $ret -ne 0 ]
|
||||||
|
@ -21,11 +21,23 @@
|
|||||||
#include "msgpack/adaptor/cpp11/tuple.hpp"
|
#include "msgpack/adaptor/cpp11/tuple.hpp"
|
||||||
#endif // #if !defined (MSGPACK_USE_CPP03)
|
#endif // #if !defined (MSGPACK_USE_CPP03)
|
||||||
|
|
||||||
|
#if defined(__GNUC__)
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wconversion"
|
||||||
|
#endif // defined(__GNUC__)
|
||||||
|
|
||||||
#include <boost/fusion/support/is_sequence.hpp>
|
#include <boost/fusion/support/is_sequence.hpp>
|
||||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||||
#include <boost/fusion/algorithm/iteration/for_each.hpp>
|
#include <boost/fusion/algorithm/iteration/for_each.hpp>
|
||||||
#include <boost/fusion/sequence/intrinsic/at.hpp>
|
#include <boost/fusion/sequence/intrinsic/at.hpp>
|
||||||
#include <boost/fusion/include/mpl.hpp>
|
#include <boost/fusion/include/mpl.hpp>
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(__GNUC__)
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif // defined(__GNUC__)
|
||||||
|
|
||||||
|
|
||||||
#include <boost/mpl/size.hpp>
|
#include <boost/mpl/size.hpp>
|
||||||
|
|
||||||
namespace msgpack {
|
namespace msgpack {
|
||||||
|
@ -26,7 +26,18 @@
|
|||||||
#include "msgpack/adaptor/vector.hpp"
|
#include "msgpack/adaptor/vector.hpp"
|
||||||
#include "msgpack/adaptor/map.hpp"
|
#include "msgpack/adaptor/map.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(__GNUC__)
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wconversion"
|
||||||
|
#endif // defined(__GNUC__)
|
||||||
|
|
||||||
#include <boost/variant.hpp>
|
#include <boost/variant.hpp>
|
||||||
|
|
||||||
|
#if defined(__GNUC__)
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif // defined(__GNUC__)
|
||||||
|
|
||||||
#include <boost/operators.hpp>
|
#include <boost/operators.hpp>
|
||||||
|
|
||||||
namespace msgpack {
|
namespace msgpack {
|
||||||
|
@ -14,6 +14,11 @@
|
|||||||
#include "msgpack/adaptor/adaptor_base.hpp"
|
#include "msgpack/adaptor/adaptor_base.hpp"
|
||||||
#include "msgpack/adaptor/check_container_size.hpp"
|
#include "msgpack/adaptor/check_container_size.hpp"
|
||||||
|
|
||||||
|
#if defined(__GNUC__)
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wconversion"
|
||||||
|
#endif // defined(__GNUC__)
|
||||||
|
|
||||||
// To suppress warning on Boost.1.58.0
|
// To suppress warning on Boost.1.58.0
|
||||||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) || defined(__clang__)
|
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) || defined(__clang__)
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
@ -26,6 +31,10 @@
|
|||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
#endif // defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) || defined(__clang__)
|
#endif // defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) || defined(__clang__)
|
||||||
|
|
||||||
|
#if defined(__GNUC__)
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif // defined(__GNUC__)
|
||||||
|
|
||||||
namespace msgpack {
|
namespace msgpack {
|
||||||
|
|
||||||
/// @cond
|
/// @cond
|
||||||
|
@ -1461,7 +1461,7 @@ TEST(MSGPACK_TIMESPEC, timespec_object_with_zone_zero)
|
|||||||
TEST(MSGPACK_TIMESPEC, timespec_pack_convert_32bit_sec)
|
TEST(MSGPACK_TIMESPEC, timespec_pack_convert_32bit_sec)
|
||||||
{
|
{
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
timespec val1{ std::numeric_limits<decltype(std::declval<timespec>().tv_sec)>::is_signed ? INT32_MAX : UINT32_MAX, 0 };
|
timespec val1{ std::numeric_limits<decltype(std::declval<timespec>().tv_sec)>::is_signed ? time_t(INT32_MAX) : time_t(UINT32_MAX), 0 };
|
||||||
|
|
||||||
msgpack::pack(ss, val1);
|
msgpack::pack(ss, val1);
|
||||||
std::string const& str = ss.str();
|
std::string const& str = ss.str();
|
||||||
@ -1477,7 +1477,7 @@ TEST(MSGPACK_TIMESPEC, timespec_pack_convert_32bit_sec)
|
|||||||
TEST(MSGPACK_TIMESPEC, timespec_object_with_zone_32bit_sec)
|
TEST(MSGPACK_TIMESPEC, timespec_object_with_zone_32bit_sec)
|
||||||
{
|
{
|
||||||
msgpack::zone z;
|
msgpack::zone z;
|
||||||
timespec val1{ std::numeric_limits<decltype(std::declval<timespec>().tv_sec)>::is_signed ? INT32_MAX : UINT32_MAX, 0 };
|
timespec val1{ std::numeric_limits<decltype(std::declval<timespec>().tv_sec)>::is_signed ? time_t(INT32_MAX) : time_t(UINT32_MAX), 0 };
|
||||||
msgpack::object obj(val1, z);
|
msgpack::object obj(val1, z);
|
||||||
timespec val2 = obj.as<timespec>();
|
timespec val2 = obj.as<timespec>();
|
||||||
EXPECT_EQ(val1.tv_sec, val2.tv_sec);
|
EXPECT_EQ(val1.tv_sec, val2.tv_sec);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user