Fix C++ warnings

This commit is contained in:
Ben Merritt 2017-12-09 15:42:41 -08:00
parent 0d95926969
commit 2997a8f0c7
3 changed files with 7 additions and 2 deletions

View File

@ -15,7 +15,9 @@ MODULE_big := pg_libphonenumber
OBJS := $(patsubst %.cpp,%.o,$(cpp_files)) OBJS := $(patsubst %.cpp,%.o,$(cpp_files))
# C flags # C flags
PG_CPPFLAGS := -fPIC -std=c++11 -Isrc/ -I/usr/include PG_CPPFLAGS := -fPIC -std=gnu++14
PG_CPPFLAGS += -Isrc/ -I/usr/include
PG_CPPFLAGS += -Wall -Wextra
ifeq ($(CONFIG),debug) ifeq ($(CONFIG),debug)
PG_CPPFLAGS += -g -Og PG_CPPFLAGS += -g -Og
else else

View File

@ -96,6 +96,7 @@ extern "C" {
} }
} catch(std::exception& e) { } catch(std::exception& e) {
reportException(e); reportException(e);
PG_RETURN_NULL();
} }
} }
@ -309,6 +310,7 @@ extern "C" {
} }
} catch(std::exception& e) { } catch(std::exception& e) {
reportException(e); reportException(e);
PG_RETURN_NULL();
} }
} }
@ -322,6 +324,7 @@ extern "C" {
PG_RETURN_INT32(number->country_code()); PG_RETURN_INT32(number->country_code());
} catch(std::exception& e) { } catch(std::exception& e) {
reportException(e); reportException(e);
PG_RETURN_NULL();
} }
} }
} }

View File

@ -6,7 +6,7 @@ using namespace i18n::phonenumbers;
const PhoneNumberUtil* const PhoneNumberTooLongException::phoneUtil = PhoneNumberUtil::GetInstance(); const PhoneNumberUtil* const PhoneNumberTooLongException::phoneUtil = PhoneNumberUtil::GetInstance();
PhoneNumberTooLongException::PhoneNumberTooLongException(const PhoneNumber& number, const char* msg) : PhoneNumberTooLongException::PhoneNumberTooLongException(const PhoneNumber& number, const char* msg) :
_number(number), std::runtime_error(msg) {}; std::runtime_error(msg), _number(number) {};
std::string PhoneNumberTooLongException::number_string() const { std::string PhoneNumberTooLongException::number_string() const {
std::string formatted; std::string formatted;