forked from microsoft/GSL
fix gcc build (gcc 7) (#690)
simple solution, disable the specific warning
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user