Skip to content

Commit

Permalink
Avoid unused function warning for AssertTrimmedDigits() (#151)
Browse files Browse the repository at this point in the history
It's only used in an assertion, hence it's unused when assertions are off.
  • Loading branch information
ediosyncratic authored Jan 30, 2021
1 parent bf46072 commit 3c6d2c2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions double-conversion/strtod.cc
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,11 @@ static bool IsNonZeroDigit(const char d) {
return ('1' <= d) && (d <= '9');
}

#ifdef __has_cpp_attribute
#if __has_cpp_attribute(maybe_unused)
[[maybe_unused]]
#endif
#endif
static bool AssertTrimmedDigits(const Vector<const char>& buffer) {
for(int i = 0; i < buffer.length(); ++i) {
if(!IsDigit(buffer[i])) {
Expand Down

0 comments on commit 3c6d2c2

Please sign in to comment.