Re: [Valgrind-users] Memcheck does not report any error

2013-09-30 Thread Tom Hughes
On 30/09/13 08:59, Damien R wrote: > Thanks to everyone who answered the question but I still do not > understand why foo->print() does work. For me foo is part of the object > because it is the object. Does it mean that the method print is > generated like: > void print(Foo *) > { > std::cou

Re: [Valgrind-users] Memcheck does not report any error

2013-09-30 Thread Damien R
On 09/29/2013 02:22 PM, Tom Hughes wrote: > Yes. Nothing in the "foo->print()" call actually accesses any memory > that was part of the object. > > The body of the function doesn't access any member variables, and it's > not a virtual function so the vtable is not read, so there is no > access to a

Re: [Valgrind-users] Memcheck does not report any error

2013-09-29 Thread Tom Hughes
On 29/09/13 12:16, Damien R wrote: > I am using valgrind 3.7.0 and with the following program, valgrind > reports no error. > > #include > > struct Foo > { >void print() >{ > std::cout << "foo" << std::endl; >} > }; > > int main() > { >Foo * foo = new Foo; >delete foo; >

Re: [Valgrind-users] Memcheck does not report any error

2013-09-29 Thread Philippe Waroquiers
On Sun, 2013-09-29 at 13:16 +0200, Damien R wrote: > Hi, > > > I am using valgrind 3.7.0 and with the following program, valgrind > reports no error. > > > #include > > struct Foo > { > void print() > { > std::cout << "foo" << std::endl; > } > }; > > int main() > { > Foo * foo =

Re: [Valgrind-users] Memcheck does not report any error

2013-09-29 Thread Matthias Schwarzott
On 29.09.2013 13:16, Damien R wrote: Hi, I am using valgrind 3.7.0 and with the following program, valgrind reports no error. #include struct Foo { void print() { std::cout << "foo" << std::endl; } }; int main() { Foo * foo = new Foo; delete foo; foo->print(); return 0; }