forked from boostorg/regex
Merge pull request #65 from boostorg/git_issue61
Tentative fix for msvc warnings.
This commit is contained in:
36
.travis.yml
36
.travis.yml
@ -102,6 +102,42 @@ matrix:
|
|||||||
sources:
|
sources:
|
||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=03,11 CXXSTD_DIALECT=cxxstd-dialect=gnu
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- g++-7
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=14,1z CXXSTD_DIALECT=cxxstd-dialect=gnu
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- g++-7
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=03,11 CXXSTD_DIALECT=cxxstd-dialect=gnu
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- g++-8
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=14,1z CXXSTD_DIALECT=cxxstd-dialect=gnu
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- g++-8
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11
|
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11
|
||||||
|
|
||||||
|
@ -201,7 +201,10 @@
|
|||||||
# define BOOST_REGEX_HAS_OTHER_WCHAR_T
|
# define BOOST_REGEX_HAS_OTHER_WCHAR_T
|
||||||
# ifdef BOOST_MSVC
|
# ifdef BOOST_MSVC
|
||||||
# pragma warning(push)
|
# pragma warning(push)
|
||||||
# pragma warning(disable : 4251 4231)
|
# pragma warning(disable : 4251)
|
||||||
|
#if BOOST_MSVC < 1700
|
||||||
|
# pragma warning(disable : 4231)
|
||||||
|
#endif
|
||||||
# if BOOST_MSVC < 1600
|
# if BOOST_MSVC < 1600
|
||||||
# pragma warning(disable : 4660)
|
# pragma warning(disable : 4660)
|
||||||
# endif
|
# endif
|
||||||
|
@ -36,10 +36,16 @@
|
|||||||
namespace boost{
|
namespace boost{
|
||||||
#ifdef BOOST_MSVC
|
#ifdef BOOST_MSVC
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable : 4251 4231 4800)
|
#pragma warning(disable : 4251)
|
||||||
|
#if BOOST_MSVC < 1700
|
||||||
|
# pragma warning(disable : 4231)
|
||||||
|
#endif
|
||||||
#if BOOST_MSVC < 1600
|
#if BOOST_MSVC < 1600
|
||||||
#pragma warning(disable : 4660)
|
#pragma warning(disable : 4660)
|
||||||
#endif
|
#endif
|
||||||
|
#if BOOST_MSVC < 1910
|
||||||
|
#pragma warning(disable:4800)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace BOOST_REGEX_DETAIL_NS{
|
namespace BOOST_REGEX_DETAIL_NS{
|
||||||
|
@ -33,7 +33,9 @@
|
|||||||
|
|
||||||
#ifdef BOOST_MSVC
|
#ifdef BOOST_MSVC
|
||||||
# pragma warning(push)
|
# pragma warning(push)
|
||||||
# pragma warning(disable: 4800)
|
#if BOOST_MSVC < 1910
|
||||||
|
#pragma warning(disable:4800)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace boost{
|
namespace boost{
|
||||||
|
@ -35,7 +35,10 @@ namespace BOOST_REGEX_DETAIL_NS{
|
|||||||
|
|
||||||
#ifdef BOOST_MSVC
|
#ifdef BOOST_MSVC
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable:4244 4800)
|
#pragma warning(disable:4244)
|
||||||
|
#if BOOST_MSVC < 1910
|
||||||
|
#pragma warning(disable:4800)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
inline boost::intmax_t umax(mpl::false_ const&)
|
inline boost::intmax_t umax(mpl::false_ const&)
|
||||||
|
@ -84,7 +84,10 @@ template class BOOST_REGEX_DECL ::boost::BOOST_REGEX_DETAIL_NS::perl_matcher<BOO
|
|||||||
|
|
||||||
# ifdef BOOST_MSVC
|
# ifdef BOOST_MSVC
|
||||||
# pragma warning(push)
|
# pragma warning(push)
|
||||||
# pragma warning(disable : 4251 4231)
|
# pragma warning(disable : 4251)
|
||||||
|
#if BOOST_MSVC < 1700
|
||||||
|
# pragma warning(disable : 4231)
|
||||||
|
#endif
|
||||||
# if BOOST_MSVC < 1600
|
# if BOOST_MSVC < 1600
|
||||||
# pragma warning(disable : 4660)
|
# pragma warning(disable : 4660)
|
||||||
# endif
|
# endif
|
||||||
@ -119,9 +122,17 @@ template class BOOST_REGEX_TEMPLATE_DECL ::boost::BOOST_REGEX_DETAIL_NS::perl_ma
|
|||||||
|
|
||||||
#elif (defined(__GNUC__) && (__GNUC__ >= 3)) || !defined(BOOST_NO_CXX11_EXTERN_TEMPLATE)
|
#elif (defined(__GNUC__) && (__GNUC__ >= 3)) || !defined(BOOST_NO_CXX11_EXTERN_TEMPLATE)
|
||||||
|
|
||||||
#ifdef __clang__
|
#if defined(__clang__)
|
||||||
#pragma clang diagnostic push
|
# pragma clang diagnostic push
|
||||||
#pragma clang diagnostic ignored "-Wkeyword-macro"
|
# if defined(__APPLE_CC__)
|
||||||
|
# if (__clang_major__ > 6)
|
||||||
|
# pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||||
|
# endif
|
||||||
|
# else
|
||||||
|
# if (__clang_major__ > 3) || ((__clang_major__ == 3) && (__clang_minor__ > 5))
|
||||||
|
# pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# ifndef BOOST_REGEX_INSTANTIATE
|
# ifndef BOOST_REGEX_INSTANTIATE
|
||||||
|
@ -33,7 +33,10 @@
|
|||||||
namespace boost{
|
namespace boost{
|
||||||
#ifdef BOOST_MSVC
|
#ifdef BOOST_MSVC
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable : 4251 4231)
|
#pragma warning(disable : 4251)
|
||||||
|
#if BOOST_MSVC < 1700
|
||||||
|
# pragma warning(disable : 4231)
|
||||||
|
#endif
|
||||||
# if BOOST_MSVC < 1600
|
# if BOOST_MSVC < 1600
|
||||||
# pragma warning(disable : 4660)
|
# pragma warning(disable : 4660)
|
||||||
# endif
|
# endif
|
||||||
|
@ -27,7 +27,9 @@
|
|||||||
|
|
||||||
#ifdef BOOST_MSVC
|
#ifdef BOOST_MSVC
|
||||||
# pragma warning(push)
|
# pragma warning(push)
|
||||||
# pragma warning(disable: 4800)
|
#if BOOST_MSVC < 1910
|
||||||
|
#pragma warning(disable:4800)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace boost{
|
namespace boost{
|
||||||
@ -353,7 +355,10 @@ struct recursion_info
|
|||||||
|
|
||||||
#ifdef BOOST_MSVC
|
#ifdef BOOST_MSVC
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable : 4251 4231)
|
#pragma warning(disable : 4251)
|
||||||
|
#if BOOST_MSVC < 1700
|
||||||
|
# pragma warning(disable : 4231)
|
||||||
|
#endif
|
||||||
# if BOOST_MSVC < 1600
|
# if BOOST_MSVC < 1600
|
||||||
# pragma warning(disable : 4660)
|
# pragma warning(disable : 4660)
|
||||||
# endif
|
# endif
|
||||||
|
@ -36,7 +36,9 @@
|
|||||||
#endif
|
#endif
|
||||||
#ifdef BOOST_MSVC
|
#ifdef BOOST_MSVC
|
||||||
# pragma warning(push)
|
# pragma warning(push)
|
||||||
# pragma warning(disable: 4800)
|
#if BOOST_MSVC < 1910
|
||||||
|
#pragma warning(disable:4800)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace boost{
|
namespace boost{
|
||||||
|
@ -34,7 +34,10 @@
|
|||||||
#endif
|
#endif
|
||||||
#ifdef BOOST_MSVC
|
#ifdef BOOST_MSVC
|
||||||
# pragma warning(push)
|
# pragma warning(push)
|
||||||
# pragma warning(disable: 4800 4706)
|
# pragma warning(disable: 4706)
|
||||||
|
#if BOOST_MSVC < 1910
|
||||||
|
#pragma warning(disable:4800)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace boost{
|
namespace boost{
|
||||||
|
@ -138,12 +138,12 @@ public:
|
|||||||
|
|
||||||
size_type BOOST_REGEX_CALL size()
|
size_type BOOST_REGEX_CALL size()
|
||||||
{
|
{
|
||||||
return end - start;
|
return size_type(end - start);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_type BOOST_REGEX_CALL capacity()
|
size_type BOOST_REGEX_CALL capacity()
|
||||||
{
|
{
|
||||||
return last - start;
|
return size_type(last - start);
|
||||||
}
|
}
|
||||||
|
|
||||||
void* BOOST_REGEX_CALL data()const
|
void* BOOST_REGEX_CALL data()const
|
||||||
@ -153,7 +153,7 @@ public:
|
|||||||
|
|
||||||
size_type BOOST_REGEX_CALL index(void* ptr)
|
size_type BOOST_REGEX_CALL index(void* ptr)
|
||||||
{
|
{
|
||||||
return static_cast<pointer>(ptr) - static_cast<pointer>(data());
|
return size_type(static_cast<pointer>(ptr) - static_cast<pointer>(data()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void BOOST_REGEX_CALL clear()
|
void BOOST_REGEX_CALL clear()
|
||||||
|
@ -36,7 +36,9 @@ namespace boost{
|
|||||||
|
|
||||||
#ifdef BOOST_MSVC
|
#ifdef BOOST_MSVC
|
||||||
# pragma warning(push)
|
# pragma warning(push)
|
||||||
# pragma warning(disable: 4800)
|
#if BOOST_MSVC < 1910
|
||||||
|
#pragma warning(disable:4800)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace BOOST_REGEX_DETAIL_NS{
|
namespace BOOST_REGEX_DETAIL_NS{
|
||||||
|
@ -241,7 +241,7 @@ inline std::ptrdiff_t global_length<char>(const char* p)
|
|||||||
template<>
|
template<>
|
||||||
inline std::ptrdiff_t global_length<wchar_t>(const wchar_t* p)
|
inline std::ptrdiff_t global_length<wchar_t>(const wchar_t* p)
|
||||||
{
|
{
|
||||||
return (std::wcslen)(p);
|
return (std::ptrdiff_t)(std::wcslen)(p);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
template <class charT>
|
template <class charT>
|
||||||
|
@ -51,8 +51,10 @@
|
|||||||
#ifdef BOOST_MSVC
|
#ifdef BOOST_MSVC
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable:4786)
|
#pragma warning(disable:4786)
|
||||||
|
#if BOOST_MSVC < 1910
|
||||||
#pragma warning(disable:4800)
|
#pragma warning(disable:4800)
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost{
|
namespace boost{
|
||||||
|
|
||||||
|
@ -196,3 +196,8 @@ build-project ../example ;
|
|||||||
|
|
||||||
# `quick` target (for CI)
|
# `quick` target (for CI)
|
||||||
run quick.cpp ../build//boost_regex ;
|
run quick.cpp ../build//boost_regex ;
|
||||||
|
|
||||||
|
compile test_warnings.cpp
|
||||||
|
: <toolset>msvc:<warnings>all <toolset>msvc:<warnings-as-errors>on
|
||||||
|
<toolset>gcc:<warnings>all <toolset>gcc:<warnings-as-errors>on
|
||||||
|
<toolset>clang:<warnings>all <toolset>clang:<warnings-as-errors>on ;
|
||||||
|
29
test/test_warnings.cpp
Normal file
29
test/test_warnings.cpp
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Copyright (c) 2018
|
||||||
|
* John Maddock
|
||||||
|
*
|
||||||
|
* Use, modification and distribution are subject to the
|
||||||
|
* Boost Software License, Version 1.0. (See accompanying file
|
||||||
|
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(disable:4820 4668)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __APPLE_CC__
|
||||||
|
#pragma clang diagnostic ignored "-Wc++11-long-long"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <boost/regex.hpp>
|
||||||
|
|
||||||
|
void test_proc()
|
||||||
|
{
|
||||||
|
std::string text, re;
|
||||||
|
boost::regex exp(re);
|
||||||
|
regex_match(text, exp);
|
||||||
|
}
|
||||||
|
|
Reference in New Issue
Block a user