Re: [dev] warnings01: Windows C4355 'this' : used in base member initializer list

2006-04-11 Thread Nikolai Pretzell
Yes, fully agree to Joergs interpretation. Nikolai Joerg Barfurth wrote: I'd however like to establish a rule that classes/functions taking a pointer to (possibly) not fully constructed classes have a comment that explicitely allows that - assuming that everywhere else it is a bug. Is a

Re: [dev] warnings01: Windows C4355 'this' : used in base member initializer list

2006-04-10 Thread Joerg Barfurth
Mathias Bauer schrieb: Nikolai Pretzell wrote: I'd however like to establish a rule that classes/functions taking a pointer to (possibly) not fully constructed classes have a comment that explicitely allows that - assuming that everywhere else it is a bug. Is a cast to the base class when

Re: [dev] warnings01: Windows C4355 'this' : used in base member initializer list

2006-03-30 Thread Nikolai Pretzell
Hi, just to make clear, if it wasn't yet obvious: Joerg Barfurth wrote: So one could argue, fixing the warning does not necessarily fix the problem, so we can remove the warning anyway. Right. The warning (with warnings=errors) forces us to use a workaround, which may even have a negative

Re: [dev] warnings01: Windows C4355 'this' : used in base member initializer list

2006-03-30 Thread Mathias Bauer
Nikolai Pretzell wrote: I'd however like to establish a rule that classes/functions taking a pointer to (possibly) not fully constructed classes have a comment that explicitely allows that - assuming that everywhere else it is a bug. Is a cast to the base class when passing this enough?

Re: [dev] warnings01: Windows C4355 'this' : used in base member initializer list

2006-03-08 Thread Joerg Barfurth
Hi, I've got a long hate relationship with this warning, because it kept popping up and never showed a real problem in my code. Some more objective arguments against can be found inline. Nikolai Pretzell wrote: warning: test.cxx(18) : warning C4355: 'this' : used in base member

Re: [dev] warnings01: Windows C4355 'this' : used in base member initializer list

2006-03-08 Thread Carsten Driesner
Nikolai Pretzell wrote: Hi Carsten and all, warning: test.cxx(18) : warning C4355: 'this' : used in base member initializer list class A { public: A() {} }; class B { A _a; public: B( A a ) : _a(a) {} }; class C : public A { B _b; public: C() : _b( *(A*)this ) {} };

Re: [dev] warnings01: Windows C4355 'this' : used in base member initializer list

2006-03-07 Thread Malte Timmermann
I don't understand the not look too safe example: Class B will never be able to call a virtual method which is implemented in C. Not within the CTOR. And when talking about Dialogs: Moving member initialization with 'this' to the body is not easily done. You must change all Window members to

Re: [dev] warnings01: Windows C4355 'this' : used in base member initializer list

2006-03-03 Thread Nikolai Pretzell
Hi Carsten and all, warning: test.cxx(18) : warning C4355: 'this' : used in base member initializer list class A { public: A() {} }; class B { A _a; public: B( A a ) : _a(a) {} }; class C : public A { B _b; public: C() : _b( *(A*)this ) {} }; int main() { C c; }

[dev] warnings01: Windows C4355 'this' : used in base member initializer list

2006-02-17 Thread Carsten Driesner
Hi all, With the MS C++ compiler and our current warning settings, the following code example produces the warning: test.cxx(18) : warning C4355: 'this' : used in base member initializer list class A { public: A() {} }; class B { A _a; public: B( A a ) : _a(a) {} }; class C :