'os' unreferenced formal parameter

69 views
Skip to first unread message

Rockem

unread,
Aug 5, 2009, 2:27:02 PM8/5/09
to Google C++ Mocking Framework
Hello all,

I'm just starting to use this framework
and every time I compile I get a whole lot of similar errors on
different variables

what is it ?
what I'm doing wrong ?

thanx
Eli

Vlad Losev

unread,
Aug 5, 2009, 2:30:05 PM8/5/09
to Rockem, Google C++ Mocking Framework
Hi Eli,

 
Can you please provide a short but complete program triggering the error messages and the full texts of the messages themselves?

thanx
Eli

Regards,
Vlad

Rockem

unread,
Aug 5, 2009, 3:14:46 PM8/5/09
to Google C++ Mocking Framework
Yes
------ Code --------
#include <gmock/gmock.h>
class Interface {
public:
virtual ~Interface() {}
virtual void foo() = 0;
};

class MockInterface : public Interface {
public:
MOCK_METHOD0(foo, void());
};

TEST(MockTest, bla) {
MockInterface a;
EXPECT_CALL(a, foo());
}
------ Code ----------

----- Output -----------
recipelistcontroller_test.cpp
E:\Source\mamatkon\trunk\include\gmock/gmock-matchers.h(92) : warning
C4100: 'os' : unreferenced formal parameter
E:\Source\mamatkon\trunk\include\gmock/gmock-matchers.h(92) : while
compiling class template member function 'void
testing::MatcherInterface<T>::ExplainMatchResultTo(T,std::ostream *)
const'
with
[
T=const
std::basic_string<char,std::char_traits<char>,std::allocator<char>> &
]
E:\Source\mamatkon\trunk\include\gtest/internal/gtest-linked_ptr.h
(204) : see reference to class template instantiation
'testing::MatcherInterface<T>' being compiled
with
[
T=const
std::basic_string<char,std::char_traits<char>,std::allocator<char>> &
]
E:\Source\mamatkon\trunk\include\gtest/internal/gtest-linked_ptr.h
(203) : while compiling class template member function 'void
testing::internal::linked_ptr<T>::depart(void)'
with
[
T=const testing::MatcherInterface<const
std::basic_string<char,std::char_traits<char>,std::allocator<char>> &>
]
E:\Source\mamatkon\trunk\include\gmock/gmock-matchers.h(142) : see
reference to class template instantiation
'testing::internal::linked_ptr<T>' being compiled
with
[
T=const testing::MatcherInterface<const
std::basic_string<char,std::char_traits<char>,std::allocator<char>> &>
]
E:\Source\mamatkon\trunk\include\gmock/gmock-matchers.h(182) : see
reference to class template instantiation
'testing::internal::MatcherBase<T>' being compiled
with
[
T=const testing::internal::string &
]
E:\Source\mamatkon\trunk\include\gmock/gmock-matchers.h(92) : warning
C4100: 'x' : unreferenced formal parameter
E:\Source\mamatkon\trunk\include\gmock/gmock-matchers.h(92) : warning
C4100: 'os' : unreferenced formal parameter
E:\Source\mamatkon\trunk\include\gmock/gmock-matchers.h(92) : while
compiling class template member function 'void
testing::MatcherInterface<T>::ExplainMatchResultTo(T,std::ostream *)
const'
with
[
T=testing::internal::string
]
E:\Source\mamatkon\trunk\include\gtest/internal/gtest-linked_ptr.h
(204) : see reference to class template instantiation
'testing::MatcherInterface<T>' being compiled
with
[
T=testing::internal::string
]
E:\Source\mamatkon\trunk\include\gtest/internal/gtest-linked_ptr.h
(203) : while compiling class template member function 'void
testing::internal::linked_ptr<T>::depart(void)'
with
[
T=const testing::MatcherInterface<testing::internal::string>
]
E:\Source\mamatkon\trunk\include\gmock/gmock-matchers.h(142) : see
reference to class template instantiation
'testing::internal::linked_ptr<T>' being compiled
with
[
T=const testing::MatcherInterface<testing::internal::string>
]
E:\Source\mamatkon\trunk\include\gmock/gmock-matchers.h(199) : see
reference to class template instantiation
'testing::internal::MatcherBase<T>' being compiled
with
[
T=testing::internal::string
]
E:\Source\mamatkon\trunk\include\gmock/gmock-matchers.h(92) : warning
C4100: 'os' : unreferenced formal parameter
E:\Source\mamatkon\trunk\include\gmock/gmock-matchers.h(92) : while
compiling class template member function 'void
testing::MatcherInterface<T>::ExplainMatchResultTo(T,std::ostream *)
const'
with
[
T=const std::tr1::tuple<> &
]
E:\Source\mamatkon\trunk\include\gtest/internal/gtest-linked_ptr.h
(204) : see reference to class template instantiation
'testing::MatcherInterface<T>' being compiled
with
[
T=const std::tr1::tuple<> &
]
E:\Source\mamatkon\trunk\include\gtest/internal/gtest-linked_ptr.h
(203) : while compiling class template member function 'void
testing::internal::linked_ptr<T>::depart(void)'
with
[
T=const testing::MatcherInterface<const std::tr1::tuple<> &>
]
E:\Source\mamatkon\trunk\include\gmock/gmock-matchers.h(142) : see
reference to class template instantiation
'testing::internal::linked_ptr<T>' being compiled
with
[
T=const testing::MatcherInterface<const std::tr1::tuple<> &>
]
E:\Source\mamatkon\trunk\include\gmock/gmock-matchers.h(162) : see
reference to class template instantiation
'testing::internal::MatcherBase<T>' being compiled
with
[
T=const std::tr1::tuple<> &
]
E:\Source\mamatkon\trunk\include\gmock/gmock-spec-builders.h(943) :
see reference to class template instantiation 'testing::Matcher<T>'
being compiled
with
[
T=const std::tr1::tuple<> &
]
test\recipelistcontroller_test.cpp(38) : see reference to class
template instantiation 'testing::internal::Expectation<F>' being
compiled
with
[
F=void (void)
]
E:\Source\mamatkon\trunk\include\gmock/gmock-matchers.h(92) : warning
C4100: 'x' : unreferenced formal parameter
E:\Source\mamatkon\trunk\include\gmock/gmock-matchers.h(393) : warning
C4100: 'value_tuple' : unreferenced formal parameter
E:\Source\mamatkon\trunk\include\gmock/gmock-matchers.h(418) : see
reference to function template instantiation 'bool
testing::internal::TuplePrefix<0>::Matches<MatcherTuple,ValueTuple>
(const MatcherTuple &,const ValueTuple &)' being compiled
with
[
MatcherTuple=std::tr1::tuple<>,
ValueTuple=std::tr1::tuple<>
]
E:\Source\mamatkon\trunk\include\gmock/gmock-spec-builders.h(181) :
see reference to function template instantiation 'bool
testing::internal::TupleMatches<std::tr1::tuple<>,std::tr1::tuple<>>
(const MatcherTuple &,const ValueTuple &)' being compiled
with
[
MatcherTuple=std::tr1::tuple<>,
ValueTuple=std::tr1::tuple<>
]
E:\Source\mamatkon\trunk\include\gmock/gmock-spec-builders.h(180) :
while compiling class template member function 'bool
testing::internal::DefaultActionSpec<F>::Matches(const
std::tr1::tuple<> &) const'
with
[
F=void (void)
]
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\vector(1112) :
see reference to class template instantiation
'testing::internal::DefaultActionSpec<F>' being compiled
with
[
F=void (void)
]
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\vector(1102) :
while compiling class template member function 'bool
std::vector<_Ty>::_Buy(unsigned int)'
with
[
_Ty=testing::internal::DefaultActionSpec<void (void)>
]
E:\Source\mamatkon\trunk\include\gmock/gmock-spec-builders.h(1322) :
see reference to class template instantiation 'std::vector<_Ty>' being
compiled
with
[
_Ty=testing::internal::DefaultActionSpec<void (void)>
]
E:\Source\mamatkon\trunk\include\gmock/gmock-generated-function-
mockers.h(64) : see reference to class template instantiation
'testing::internal::FunctionMockerBase<F>' being compiled
with
[
F=void (void)
]
test\recipelistcontroller_test.cpp(33) : see reference to class
template instantiation 'testing::internal::FunctionMocker<Function>'
being compiled
with
[
Function=void (void)
]
E:\Source\mamatkon\trunk\include\gmock/gmock-matchers.h(392) : warning
C4100: 'matcher_tuple' : unreferenced formal parameter
E:\Source\mamatkon\trunk\include\gmock/gmock-matchers.h(400) : warning
C4100: 'os' : unreferenced formal parameter
E:\Source\mamatkon\trunk\include\gmock/gmock-matchers.h(429) : see
reference to function template instantiation 'void
testing::internal::TuplePrefix<0>::DescribeMatchFailuresTo<MatcherTuple,ValueTuple>
(const MatcherTuple &,const ValueTuple &,std::ostream *)' being
compiled
with
[
MatcherTuple=std::tr1::tuple<>,
ValueTuple=std::tr1::tuple<>
]
E:\Source\mamatkon\trunk\include\gmock/gmock-spec-builders.h(786) :
see reference to function template instantiation 'void
testing::internal::DescribeMatchFailureTupleTo<std::tr1::tuple<>,std::tr1::tuple<>>
(const MatcherTuple &,const ValueTuple &,std::ostream *)' being
compiled
with
[
MatcherTuple=std::tr1::tuple<>,
ValueTuple=std::tr1::tuple<>
]
E:\Source\mamatkon\trunk\include\gmock/gmock-spec-builders.h(778) :
while compiling class template member function 'void
testing::internal::Expectation<F>::DescribeMatchResultTo(const
std::tr1::tuple<> &,std::ostream *) const'
with
[
F=void (void)
]
E:\Source\mamatkon\trunk\include\gmock/gmock-matchers.h(399) : warning
C4100: 'values' : unreferenced formal parameter
E:\Source\mamatkon\trunk\include\gmock/gmock-matchers.h(398) : warning
C4100: 'matchers' : unreferenced formal parameter
E:\Source\mamatkon\trunk\include\gmock/gmock-matchers.h(497) : warning
C4100: 'x' : unreferenced formal parameter
E:\Source\mamatkon\trunk\include\gmock/gmock-matchers.h(497) : while
compiling class template member function 'bool
testing::internal::AnyMatcherImpl<T>::Matches(T) const'
with
[
T=const std::tr1::tuple<> &
]
E:\Source\mamatkon\trunk\include\gmock/gmock-matchers.h(1658) : see
reference to class template instantiation
'testing::internal::AnyMatcherImpl<T>' being compiled
with
[
T=const std::tr1::tuple<> &
]
E:\Source\mamatkon\trunk\include\gmock/gmock-matchers.h(514) : see
reference to function template instantiation 'testing::Matcher<T>
testing::A<T>(void)' being compiled
with
[
T=const std::tr1::tuple<> &
]
E:\Source\mamatkon\trunk\include\gmock/gmock-spec-builders.h(573) :
see reference to function template instantiation
'testing::internal::AnythingMatcher::operator testing::Matcher<T>
(void) const<const std::tr1::tuple<>&>' being compiled
with
[
T=const std::tr1::tuple<> &
]
E:\Source\mamatkon\trunk\include\gmock/gmock-spec-builders.h(563) :
while compiling class template member function
'testing::internal::Expectation<F>::Expectation
(testing::internal::FunctionMockerBase<F> *,const char *,int,const
std::tr1::tuple<> &)'
with
[
F=void (void)
]
--------------------------Output------------------


On Aug 5, 9:30 pm, Vlad Losev <vl...@google.com> wrote:
> Hi Eli,
>

Vlad Losev

unread,
Aug 5, 2009, 3:53:16 PM8/5/09
to Rockem, Google C++ Mocking Framework
Hi Eli,

These are warnings, not errors. They are annoying but do not really indicate errors. They have been fixed in the Subversion repository, but haven't yet made it into a release. So your options are:
  • Suppress those warnings by adding /wd4100 to your compiler options in gtest and your test projects. This is not optimal as will affect this warning in your code as well.
  • Grab the latest revision of gMock from the source code repository.
  • Wait for the gMock 1.2 release (but this may take a while).
HTH,
Vlad.
Reply all
Reply to author
Forward
0 new messages