This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Weird behaviour of g++-3.2 with references
- From: <Aurelien dot Delaitre at loria dot fr>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 5 Jun 2003 16:26:53 -0200 (MET DST)
- Subject: Weird behaviour of g++-3.2 with references
Hello,
I had trouble compiling NeL (Nevrax Library) with g++-3.2 (3.2.3-0pre9 on
Debian Sarge).
Here's the original code which does not compile (from
nel/src/3d/zone_manager.cpp:154):
// Make a position
uint x, y;
getZonePos (newZone.ZoneToAddId, x, y);
rAFM.addTask (new CZoneLoadingTask(newZone.ZoneToAddName, &newZone.Zone,
CVector ((float)x, -(float)y, 0)));
This one compiles:
// Make a position
uint x, y;
getZonePos (newZone.ZoneToAddId, x, y);
CVector v = CVector ((float)x, -(float)y, 0);
rAFM.addTask (new CZoneLoadingTask(newZone.ZoneToAddName, &newZone.Zone, v));
Here is the error log:
make[3]: Entering directory `/usr/src/code/nel/src/3d'
/bin/sh ../../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I.
-I../../include -I../../src -I/usr/include/freetype2 -O3 -DNL_RELEASE
-ftemplate-depth-24 -march=i686 -Wall -Wno-multichar -D_REENTRANT
-I/usr/X11R6/include -I/usr/include/stlport -I/usr/include/libxml2
-I../../include -DHAVE_NELCONFIG_H -c zone_manager.cpp
rm -f .libs/zone_manager.lo
g++ -DHAVE_CONFIG_H -I. -I. -I../../include -I../../src
-I/usr/include/freetype2 -O3 -DNL_RELEASE -ftemplate-depth-24 -march=i686
-Wall -Wno-multichar -D_REENTRANT -I/usr/X11R6/include
-I/usr/include/stlport -I/usr/include/libxml2 -I../../include
-DHAVE_NELCONFIG_H -Wp,-MD,.deps/zone_manager.pp -c zone_manager.cpp -fPIC
-DPIC -o .libs/zone_manager.lo
zone_manager.cpp: In member function `void
NL3D::CZoneManager::checkZonesAround(unsigned int, unsigned int, unsigned
int)':
zone_manager.cpp:157: no matching function for call to `NL3D::CZoneLoadingTask
::CZoneLoadingTask(_STL::string&, volatile NL3D::CZone**, NLMISC::CVector)'
../../src/3d/zone_manager.h:149: candidates are:
NL3D::CZoneLoadingTask::CZoneLoadingTask(const NL3D::CZoneLoadingTask&)
../../src/3d/zone_manager.h:152:
NL3D::CZoneLoadingTask::CZoneLoadingTask(const _STL::string&, volatile
NL3D::CZone**, NLMISC::CVector&)
zone_manager.cpp: In member function `virtual void
NL3D::CZoneLoadingTask::run()':
zone_manager.cpp:246: warning: left-hand operand of comma expression has no
effect
zone_manager.cpp:246: warning: statement with no effect
make[3]: *** [zone_manager.lo] Erreur 1
The CVS snapshot of NeL (which generates this error) and the patch for
zone_manager.cpp are available on http://ghostdive.homelinux.net
Aurélien