Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#107 L4 compile warning in ExceptionTestCaseDecorator.h (+fix)

open
nobody
None
5
2004-02-11
2004-02-11
Martin Harper
No

When compiling in VC++ with level four warnings, I get
the following warning:

----

c:\Programming\cppunit-1.9.11
\include\cppunit\extensions\ExceptionTestCaseDecorator.
h(95) : warning C4100: 'e' : unreferenced formal
parameter
c:\Programming\cppunit-1.9.11
\include\cppunit\extensions\ExceptionTestCaseDecorator.
h(96) : while compiling class-template member
function 'void
CppUnit::ExceptionTestCaseDecorator<ExpectedExceptio
n>::checkException
(CppUnit::ExceptionTestCaseDecorator<ExpectedExcepti
on>::ExpectedExceptionType &)'
with
[
ExpectedException=std::invalid_argument
]

c:\Programming\src\SubSpace\SubSpaceUnitTester\Comp
anyEditTest.h(29) : see reference to class template
instantiation 'CppUnit::ExceptionTestCaseDecorator<Expe
ctedException>' being compiled
with
[
ExpectedException=std::invalid_argument
]

----

You can edit your code so that this warning is not given
by editing the code in ExceptionTestCaseDecorator.h as
follows:

OLD:
virtual void checkException( ExpectedExceptionType
&e )

NEW:
virtual void checkException( ExpectedExceptionType
&/*e*/ )

Thanks!

Discussion

  • Logged In: NO

    Yes, I've got the same problem when compiling my library
    marc.waeckerlin.org/mrw-c++ with option --enable-pedantic
    (GNU g++, cppunit version: 1.10.2).

    It would be nice, if it could be corrected for the next
    release (it's such a small change, just remove the "e").

    Thank you, regards Marc