Commit 33c0af07 by zhanyong.wan

Makes gmock compile clean with gcc -Wall -Wextra.

parent 7e571ef5
...@@ -709,6 +709,15 @@ $range j2 2..i ...@@ -709,6 +709,15 @@ $range j2 2..i
// on http://code.google.com/p/googlemock/wiki/CookBook. // on http://code.google.com/p/googlemock/wiki/CookBook.
$range i 0..n $range i 0..n
$range k 0..n-1
// An internal macro needed for implementing ACTION*().
#define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\
const args_type& args GTEST_ATTRIBUTE_UNUSED_
$for k [[,\
arg$k[[]]_type arg$k GTEST_ATTRIBUTE_UNUSED_]]
$for i $for i
[[ [[
...@@ -735,7 +744,6 @@ $var param_field_decls2 = [[$for j ...@@ -735,7 +744,6 @@ $var param_field_decls2 = [[$for j
]]]] ]]]]
$var params = [[$for j, [[p$j]]]] $var params = [[$for j, [[p$j]]]]
$var param_types = [[$if i==0 [[]] $else [[<$for j, [[p$j##_type]]>]]]] $var param_types = [[$if i==0 [[]] $else [[<$for j, [[p$j##_type]]>]]]]
$range k 0..n-1
$var typename_arg_types = [[$for k, [[typename arg$k[[]]_type]]]] $var typename_arg_types = [[$for k, [[typename arg$k[[]]_type]]]]
$var arg_types_and_names = [[$for k, [[arg$k[[]]_type arg$k]]]] $var arg_types_and_names = [[$for k, [[arg$k[[]]_type arg$k]]]]
$var macro_name = [[$if i==0 [[ACTION]] $elif i==1 [[ACTION_P]] $var macro_name = [[$if i==0 [[ACTION]] $elif i==1 [[ACTION_P]]
...@@ -771,9 +779,8 @@ $arg_types_and_names) const;\$param_field_decls ...@@ -771,9 +779,8 @@ $arg_types_and_names) const;\$param_field_decls
template <typename F>\ template <typename F>\
template <$typename_arg_types>\ template <$typename_arg_types>\
typename ::testing::internal::Function<F>::Result\ typename ::testing::internal::Function<F>::Result\
$class_name$param_types::\ $class_name$param_types::gmock_Impl<F>::gmock_PerformImpl(\
gmock_Impl<F>::gmock_PerformImpl(const args_type& args, [[]] GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
$arg_types_and_names) const
]] ]]
$$ } // This meta comment fixes auto-indentation in Emacs. It won't $$ } // This meta comment fixes auto-indentation in Emacs. It won't
$$ // show up in the generated code. $$ // show up in the generated code.
......
...@@ -31,7 +31,7 @@ CPPFLAGS += -I$(GMOCK_DIR) -I$(GMOCK_DIR)/include \ ...@@ -31,7 +31,7 @@ CPPFLAGS += -I$(GMOCK_DIR) -I$(GMOCK_DIR)/include \
-I$(GTEST_DIR) -I$(GTEST_DIR)/include -I$(GTEST_DIR) -I$(GTEST_DIR)/include
# Flags passed to the C++ compiler. # Flags passed to the C++ compiler.
CXXFLAGS += -g -Wall -Wextra -Wno-unused-parameter CXXFLAGS += -g -Wall -Wextra
# All tests produced by this Makefile. Remember to add new tests you # All tests produced by this Makefile. Remember to add new tests you
# created to the list. # created to the list.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment