Please find enclosed a patch which allows cppunit-1.12.1 to build without
warnings when using gcc-4.1 with "-ansi -W -Wall -Werror".
The patch fixes several files and deals almost entirely with unused
variable warnings (which I tend to fix through the use of anonymous
parameters) although there is also one change to call a default constructor
in an initialization list. The only really critical
patch is the one for
cppunit/include/cppunit/extensions/ExceptionTestCaseDecorator.h
which is the single public header involved.
To test the patch I did the following:
------------------------------------
$ cvs -z3 -d:pserver:anonymous@cppunit.cvs.sourceforge.net:/cvsroot/cppunit
co -P cppunit
$ cd cppunit
$ patch -p0 < ../../cppunit/cppunit-1.12.1-nowarn.patch
[...bunch of messages...]
$ ./autogen.sh
[... some messages...]
$ ./configure
[... more messages...]
$ make CXXFLAGS="-W -Wall -Werror -ansi $CXXFLAGS"
[... lots of messages...]
$ make CXXFLAGS="-W -Wall -Werror -ansi $CXXFLAGS" check
[... and even more messages ...]
------------------------------------
where the -Werror flag ensures that had there been a warning from g++ then
the compiler would have stopped there.
I changed the flags on the "make" command line, but I would have preferred
to do it in the automake/autoconf structure. Unfortunately, it wasn't
obvious how to set compiler specific flags (e.g. "if you're using g++ then
set CXXFLAGS as above, otherwise don't") and I didn't want to delay the
patch for that. Perhaps someone with more experience with the GNU
autotools can set that up.
Nobody/Anonymous
compilation/portability
None
Public
|
Date: 2008-02-21 03:20
|
| Filename | Description | Download |
|---|---|---|
| cppunit-1.12.1-nowarn.patch | Patches to stop warnings while building cppunit | Download |
| Field | Old Value | Date | By |
|---|---|---|---|
| status_id | Open | 2008-02-21 03:20 | smr99 |
| resolution_id | None | 2008-02-21 03:20 | smr99 |
| close_date | - | 2008-02-21 03:20 | smr99 |
| File Added | 267255: cppunit-1.12.1-nowarn.patch | 2008-02-20 22:22 | dpkatz |