Warning in VC++ compilation

D. R. Evans N7DR____arrl.net
Fri Sep 14 23:11:46 CEST 2001


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

When building agent++ with VC++ 6.0, I receive the following warning:

TaskManager::TaskManager(ThreadPool *tp, int stackSize):thread(*this)

c:\agent\src\threads.cpp(660) : warning C4355: 'this' : used in base member 
initializer list

I haven't looked to see whether any actual harm is being done in this particular 
case, but in general it's a very bad idea to use a non-existant object in a 
constructor. (The point being that at the time that the thread() constructor is 
called, it is called with a parameter that is a derived object that does not yet 
exist. I believe that this is at best non-portable, and at worst could be fatal 
at run-time.)

  Doc Evans




- ----------------------------------------------------------
D.R. Evans N7DR / G4AMJ                      N7DR at arrl.net

A dead lawyer in a Colorado ski resort and an Australian detective 
who 
doesn't play by the rules: 
   "All Or Nothing" is now available. 
See http://www.sff.net/people/N7DR/drevans.htp for details.
- ----------------------------------------------------------


-----BEGIN PGP SIGNATURE-----
Version: PGP 6.0.2 -- QDPGP 2.60 
Comment: Key obtainable from servers: ID 0x362912B8

iQA/AwUBO6Jyk2nXrLw2KRK4EQJZAgCgwBRyf08wJFgr5XIUg2UQUTu+b5IAoIjW
2+3MiWgHFZkq7bdfNhQu1zse
=6hSX
-----END PGP SIGNATURE-----



More information about the AGENTPP mailing list