Fix C++ warnings
This commit is contained in:
parent
0d95926969
commit
2997a8f0c7
4
Makefile
4
Makefile
|
@ -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
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue