mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-28 18:41:57 -05:00
fix gcc build (gcc 7) (#690)
simple solution, disable the specific warning
This commit is contained in:
parent
cb2d1af89a
commit
ffdaf0fb21
19
.travis.yml
19
.travis.yml
@ -160,17 +160,16 @@ matrix:
|
||||
- env: COMPILER=g++-6 BUILD_TYPE=Release
|
||||
addons: *gcc6
|
||||
|
||||
# Currently fails due to #525
|
||||
## GCC 7
|
||||
#- env: COMPILER=g++-7 BUILD_TYPE=Debug
|
||||
# addons: &gcc7
|
||||
# apt:
|
||||
# packages: g++-7
|
||||
# sources:
|
||||
# - ubuntu-toolchain-r-test
|
||||
# GCC 7
|
||||
- env: COMPILER=g++-7 BUILD_TYPE=Debug
|
||||
addons: &gcc7
|
||||
apt:
|
||||
packages: g++-7
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
#- env: COMPILER=g++-7 BUILD_TYPE=Release
|
||||
# addons: *gcc7
|
||||
- env: COMPILER=g++-7 BUILD_TYPE=Release
|
||||
addons: *gcc7
|
||||
|
||||
|
||||
install:
|
||||
|
@ -51,6 +51,16 @@
|
||||
#endif // _MSC_VER < 1910
|
||||
#endif // _MSC_VER
|
||||
|
||||
// GCC 7 does not like the signed unsigned missmatch (size_t ptrdiff_t)
|
||||
// While there is a conversion from signed to unsigned, it happens at
|
||||
// compiletime, so the compiler wouldn't have to warn indiscriminently, but
|
||||
// could check if the source value actually doesn't fit into the target type
|
||||
// and only warn in those cases.
|
||||
#if __GNUC__ > 6
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wsign-conversion"
|
||||
#endif
|
||||
|
||||
#ifdef GSL_THROW_ON_CONTRACT_VIOLATION
|
||||
#define GSL_NOEXCEPT /*noexcept*/
|
||||
#else
|
||||
@ -2225,4 +2235,8 @@ general_span_iterator<Span> operator+(typename general_span_iterator<Span>::diff
|
||||
|
||||
#endif // _MSC_VER
|
||||
|
||||
#if __GNUC__ > 6
|
||||
#pragma GCC diagnostic pop
|
||||
#endif // __GNUC__ > 6
|
||||
|
||||
#endif // GSL_MULTI_SPAN_H
|
||||
|
@ -58,6 +58,16 @@
|
||||
|
||||
#endif // _MSC_VER
|
||||
|
||||
// GCC 7 does not like the signed unsigned missmatch (size_t ptrdiff_t)
|
||||
// While there is a conversion from signed to unsigned, it happens at
|
||||
// compiletime, so the compiler wouldn't have to warn indiscriminently, but
|
||||
// could check if the source value actually doesn't fit into the target type
|
||||
// and only warn in those cases.
|
||||
#if __GNUC__ > 6
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wsign-conversion"
|
||||
#endif
|
||||
|
||||
namespace gsl
|
||||
{
|
||||
|
||||
@ -749,4 +759,8 @@ constexpr ElementType& at(span<ElementType, Extent> s, index i)
|
||||
#pragma warning(pop)
|
||||
#endif // _MSC_VER
|
||||
|
||||
#if __GNUC__ > 6
|
||||
#pragma GCC diagnostic pop
|
||||
#endif // __GNUC__ > 6
|
||||
|
||||
#endif // GSL_SPAN_H
|
||||
|
Loading…
Reference in New Issue
Block a user