From 33e8a49e33df232eeee8a294838bbb8c6a133e5a Mon Sep 17 00:00:00 2001 From: Gilles Vollant Date: Mon, 14 Mar 2022 07:14:49 +0100 Subject: [PATCH] fix build error with clang and gcc " (#2742) This very minor, trivial and risk free commit fix introduced in 8.12.45 with #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 --- cpp/src/phonenumbers/stringutil.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpp/src/phonenumbers/stringutil.cc b/cpp/src/phonenumbers/stringutil.cc index c2f1eaf5b..999b334de 100644 --- a/cpp/src/phonenumbers/stringutil.cc +++ b/cpp/src/phonenumbers/stringutil.cc @@ -88,7 +88,8 @@ bool HasSuffixString(const string& s, const string& suffix) { template 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) {