Re: speaking of C...

Subject: Re: speaking of C...
From: Andrew Dunbar (
Date: Sun Apr 15 2001 - 21:08:51 CDT

Joaquín Cuenca Abela wrote:
> ok, I've been debuggin ~2 hours to fix this one...
> NEVER call a virtual method from a constructor.
> In the constructor of XAP_EncodingManager & XAP_UnixEncodingManager we
> can found a single line:
> { initialize(); }
> I don't know why g++ was so severely screwed to build a non-sense object
> file (maybe is due to my version) instead of just build a version that
> calls the base method, and I don't know why it worked before my changes,
> but it seems to me obvious that the author of this class wanted to call
> the XAP_EncodingManager::initialize method from the XAP_EncodingManager
> ctor and XAP_UnixEncodingManager::initialize from the
> XAP_UnixEncodingManager ctor, BUT initialize actually is a VIRTUAL
> method (and it took me ~2 hours fighting with the debugger to realize
> it).

I've never been a fan of Hungarian notation but if we're using it
why are we not prefixing virtual functions with v_ ? Isn't this
what it's for?



Do You Yahoo!?
Get your free address at

This archive was generated by hypermail 2b25 : Sun Apr 15 2001 - 21:07:18 CDT