Skip to content

Commit

Permalink
remove compiler warnings in tests
Browse files Browse the repository at this point in the history
Added a gcc option to disable warnings about unused internal
declarations, disabel warnings about unused lambda captures.
  • Loading branch information
pmed committed Mar 7, 2021
1 parent 3dcb1e6 commit b4ee6f0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
@@ -1,5 +1,5 @@
CXX ?= c++
CXXFLAGS += -Wall -Wextra -std=c++14 -fPIC -fno-rtti -DV8PP_ISOLATE_DATA_SLOT=0
CXXFLAGS += -Wall -Wextra -Wno-return-type-c-linkage -Wno-unneeded-internal-declaration -std=c++14 -fPIC -fno-rtti -DV8PP_ISOLATE_DATA_SLOT=0
LDFLAGS += -shared
AR = ar
ARFLAGS = rcs
Expand Down
2 changes: 1 addition & 1 deletion build.ninja
@@ -1,5 +1,5 @@
cxx = c++
cxxflags = -Wall -Wextra -Wno-return-type-c-linkage -std=c++14 -fPIC -fno-rtti -I. -I./v8pp -DV8PP_ISOLATE_DATA_SLOT=0
cxxflags = -Wall -Wextra -Wno-return-type-c-linkage -Wno-unneeded-internal-declaration -std=c++14 -fPIC -fno-rtti -I. -I./v8pp -DV8PP_ISOLATE_DATA_SLOT=0
ldflags = -lv8 -lv8_libplatform -lv8_libbase -L. -lv8pp -ldl -lpthread

rule cxx
Expand Down
4 changes: 2 additions & 2 deletions test/test_call_from_v8.cpp
Expand Up @@ -83,7 +83,7 @@ static_assert(std::is_same<call_from_v8_traits<decltype(z)>::arg_convert<1, raw_
static_assert(std::is_same<call_from_v8_traits<decltype(z)>::arg_convert<1, shared_ptr_traits>, v8pp::convert<int>>::value, "y(int)");

// cv arg converters
static void s(std::string, std::vector<int>&, std::shared_ptr<int> const&, std::string*, std::string const*) {}
static void s(std::string, std::vector<int>&, std::shared_ptr<int> const&, std::string*, std::string const*);

static_assert(std::is_same<call_from_v8_traits<decltype(s)>::arg_convert<0, raw_ptr_traits>, v8pp::convert<std::string>>::value, "s(string)");
static_assert(std::is_same<call_from_v8_traits<decltype(s)>::arg_convert<0, shared_ptr_traits>, v8pp::convert<std::string>>::value, "s(string)");
Expand All @@ -101,7 +101,7 @@ static_assert(std::is_same<call_from_v8_traits<decltype(s)>::arg_convert<4, raw_
static_assert(std::is_same<call_from_v8_traits<decltype(s)>::arg_convert<4, shared_ptr_traits>, v8pp::convert<std::string const*>>::value, "s(std::string const*)");

// fundamental types cv arg converters
static void t(int, char&, bool const&, float*, char const*) {}
static void t(int, char&, bool const&, float*, char const*);

static_assert(std::is_same<call_from_v8_traits<decltype(t)>::arg_convert<0, raw_ptr_traits>, v8pp::convert<int>>::value, "t(int)");
static_assert(std::is_same<call_from_v8_traits<decltype(t)>::arg_convert<0, shared_ptr_traits>, v8pp::convert<int>>::value, "t(int)");
Expand Down
2 changes: 2 additions & 0 deletions test/test_class.cpp
Expand Up @@ -130,11 +130,13 @@ void test_class_()
int extra_ctor_context = 1;
auto const X_ctor = [extra_ctor_context](v8::FunctionCallbackInfo<v8::Value> const& args)
{
(void)extra_ctor_context;
return create_X<Traits>(args);
};
Z extra_dtor_context;
auto const X_dtor = [extra_dtor_context](v8::Isolate*, typename Traits::template object_pointer_type<X> const& obj)
{
(void)extra_dtor_context;
Traits::destroy(obj);
};

Expand Down

0 comments on commit b4ee6f0

Please sign in to comment.