mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
suppress bounds.1 (#950)
Suppress "warning C26481: Don't use pointer arithmetic. Use span instead (bounds.1)." Co-authored-by: Werner Henze <werner.henze+gitcommits@posteo.de>
This commit is contained in:
parent
9150ce9a95
commit
00d4a5aab6
@ -152,6 +152,9 @@ namespace details
|
|||||||
{
|
{
|
||||||
Expects(begin_ && current_ && end_);
|
Expects(begin_ && current_ && end_);
|
||||||
Expects(current_ < end_);
|
Expects(current_ < end_);
|
||||||
|
// clang-format off
|
||||||
|
GSL_SUPPRESS(bounds.1) // NO-FORMAT: attribute
|
||||||
|
// clang-format on
|
||||||
++current_;
|
++current_;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@ -183,6 +186,9 @@ namespace details
|
|||||||
if (n != 0) Expects(begin_ && current_ && end_);
|
if (n != 0) Expects(begin_ && current_ && end_);
|
||||||
if (n > 0) Expects(end_ - current_ >= n);
|
if (n > 0) Expects(end_ - current_ >= n);
|
||||||
if (n < 0) Expects(current_ - begin_ >= -n);
|
if (n < 0) Expects(current_ - begin_ >= -n);
|
||||||
|
// clang-format off
|
||||||
|
GSL_SUPPRESS(bounds.1) // NO-FORMAT: attribute
|
||||||
|
// clang-format on
|
||||||
current_ += n;
|
current_ += n;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user