Bug 54355 - make check fails - C++ scoping error - PATCHES INCLUDED
Summary: make check fails - C++ scoping error - PATCHES INCLUDED
Status: RESOLVED FIXED
Alias: None
Product: kmines
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Hadacek Nicolas
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-09 17:20 UTC by joe vannucci
Modified: 2003-02-09 23:43 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description joe vannucci 2003-02-09 17:20:52 UTC
Version:            (using KDE KDE 3.1)
Installed from:    Compiled From Sources
Compiler:          gcc version 2.95.3 
OS:          Linux

In kdegames-3.1 issuing 'make check' produces the following error:

[snip]

make[3]: Entering directory `/home/download/kde/temp/kdegames-3.1/kmines/solver'
source='test.cpp' object='test.o' libtool=no \
depfile='.deps/test.Po' tmpdepfile='.deps/test.TPo' \
depmode=gcc /bin/sh ../../admin/depcomp \
g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I../../kmines/generic -I../../kmines -I/opt/kde/include -I/usr/local/qt-3.1.1/include -I/usr/X11R6/include  -I/usr/local/fontconfig/include  -DQT_THREAD_SUPPORT  -D_REENTRANT  -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -O2 -fno-exceptions -fno-check-new -DQT_CLEAN_NAMESPACE -DQT_NO_COMPAT -DQT_NO_ASCII_CAST  -c -o test.o `test -f 'test.cpp' || echo './'`test.cpp
In file included from bfield.h:26,
                 from test.cpp:3:
../../kmines/generic/grid2d.h: In function `static double Grid2D::SquareBase::angle(Grid2D::SquareBase::Neighbour)':
../../kmines/generic/grid2d.h:271: warning: enumeration value `Nb_Neighbour' not handled in switch
../../kmines/generic/grid2d.h: In function `static enum Grid2D::SquareBase::Neighbour Grid2D::SquareBase::opposed(Grid2D::SquareBase::Neighbour)':
../../kmines/generic/grid2d.h:288: warning: enumeration value `Nb_Neighbour' not handled in switch
../../kmines/generic/grid2d.h: In function `static struct Grid2D::Coord Grid2D::SquareBase::neighbour(const Grid2D::Coord &, Grid2D::SquareBase::Neighbour)':
../../kmines/generic/grid2d.h:311: warning: enumeration value `Nb_Neighbour' not handled in switch
../../kmines/generic/grid2d.h: In function `static double Grid2D::HexagonalBase::angle(Grid2D::HexagonalBase::Neighbour)':
../../kmines/generic/grid2d.h:392: warning: enumeration value `Nb_Neighbour' not handled in switch
../../kmines/generic/grid2d.h: In function `static enum Grid2D::HexagonalBase::Neighbour Grid2D::HexagonalBase::opposed(Grid2D::HexagonalBase::Neighbour)':
../../kmines/generic/grid2d.h:407: warning: enumeration value `Nb_Neighbour' not handled in switch
../../kmines/generic/grid2d.h: In function `static struct Grid2D::Coord Grid2D::HexagonalBase::neighbour(const Grid2D::Coord &, Grid2D::HexagonalBase::Neighbour)':
../../kmines/generic/grid2d.h:423: warning: enumeration value `Nb_Neighbour' not handled in switch
test.cpp: In function `int main(int, char **)':
bfield.h:70: `bool BaseField::reveal(const Grid2D::Coord &, Grid2D::CoordSet *, bool *)' is protected
test.cpp:20: within this context
make[3]: *** [test.o] Error 1

[snip]

END

Ignoring the warnings, the problem is that kmines/solver/test.cpp calls BaseField::reveal(...), defined in bfield.h.  But reveal is protected.  The public method looks like doReveal(...).

The same problem exists for testFast.cpp.  Here's a patch for each:

--- test.cpp.copy	2003-02-09 11:11:58.000000000 -0500
+++ test.cpp	2003-02-09 11:12:07.000000000 -0500
@@ -17,7 +17,7 @@
 
     KRandomSequence random(seed);
     Coord c(random.getLong(W), random.getLong(H));
-    f.reveal(c, 0, 0);
+    f.doReveal(c, 0, 0);
 
 	CoordSet sp;
 	AdviseFull::ProbabilityMap pm;

--- testFast.cpp.copy	2003-02-09 11:12:41.000000000 -0500
+++ testFast.cpp	2003-02-09 11:12:51.000000000 -0500
@@ -17,7 +17,7 @@
 
     KRandomSequence random(seed);
     Coord c(random.getLong(W), random.getLong(H));
-    f.reveal(c, 0, 0);
+    f.doReveal(c, 0, 0);
 
 	AdviseFast::FactSet facts(&f);
 	AdviseFast::RuleSet rules(&facts);
Comment 1 Hadacek Nicolas 2003-02-09 23:43:12 UTC
corrected in 3.1 and HEAD 
thanks !