Skip to content

Commit

Permalink
fix build error with clang and gcc " (google#2742)
Browse files Browse the repository at this point in the history
This very minor, trivial and risk free commit fix introduced in 8.12.45 with google#2734
error: ignoring return value of function declared with 'warn_unused_result' attribute [-Werror,-Wunused-result]"
Without this fix, I cannot build using clang++13
  • Loading branch information
gvollant authored Mar 14, 2022
1 parent 61691cf commit 8453b42
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cpp/src/phonenumbers/stringutil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ bool HasSuffixString(const string& s, const string& suffix) {

template <typename T>
void GenericAtoi(const string& s, T* out) {
absl::SimpleAtoi(s, out);
if (!absl::SimpleAtoi(s, out))
*out = 0;
}

void safe_strto32(const string& s, int32 *n) {
Expand Down

0 comments on commit 8453b42

Please sign in to comment.