[wx-dev] Re: CVS: [ABX] wxWidgets/src/univ stdrend.cpp, 1.13, 1.14

Vadim Zeitlin vadim at wxwindows.org
Tue Oct 3 04:44:58 PDT 2006


On Tue, 03 Oct 2006 13:37:31 +0200 ABX <abx at abx.art.pl> wrote:

A> Vadim Zeitlin <vadim at wxwindows.org>:
A> > > I think it is somehow related to deeper theory of ?:
A> >
A> > Sorry, there is no deeper theory of ?:
A> 
A> I meant if I have:
A> 
A>   wxColour c1,c2;
A>   wxColour c = (condition) ? c1 : c2;
A> 
A> which part of wxColour class is responsible for moving content from c1 or c2
A> if there is none operator= nor copy constructor?

 Sorry to be pedantic, but if there is no copy ctor, it won't compile.
Notice that this is different from "no user-defined copy ctor" which just
means that the copy ctor is generated by the compiler. And the
compiler-generated copy ctor and assignment operator should be perfectly
fine for wxColour.

A> The content is not referenced so I guess compiler is doing some raw
A> copying as default and it somehow goes wrong.

 It doesn't quite do "raw copy" because wxColour derives (indirectly) from
wxObject and wxObject does have a user-defined copy ctor. But it's true
that the compiler should do bitwise copy of wxColour-specific data fields
as wxColour itself has no user-defined copy ctor. And, once again, this is
perfectly fine as wxColour members are all copyable.

A> I don't exclude compiler error but I'm just unsure where to look for
A> expected part of code excution in such probably trivial case.

 If the error were in the copy ctor, then just writing

	wxColour c(c1);

should be enough but I guess this is not the case.

A> > and if it crashes there must be a reason for it. So how exactly can I
A> > reproduce the crash?
A> 
A> Current wxCVS with OpenWatcom 1.5. I used:
A> 
A> wmake -h -f makefile.wat SHARED=0 RUNTIME_LIBS=static UNICODE=1 MONOLITHIC=1
A> USE_GUI=1 BUILD=debug WXUNIV=1 USE_OPENGL=1 USE_ODBC=1
A> 
A> I you prefer I can provide prebuilded minimal sample for you.

 But would I be able to debug it? I'm afraid I really need to run it under
debugger to see where/how does it crash. Also, it could be useful to look
at the disassembly of the code generated by the line above, I think it
could be helpful.

 Thanks,
VZ





More information about the wx-dev mailing list