Am Montag, 27. April 2009 schrieb Julian Seward:
> > However I am not sure whether this is the expected behaviour platforms
> > where a pointer and an unsigned have the same size. The following program
> > gives me also a definitely lost error, although I would expect to have a
> > "still reachable"
> >
> > #include <stdlib.h>
> >
> > int main()  {
> >      void * p = malloc(20);
> > }
>
> "still reachable" at when exactly?  That is the question.  After main()
> exits it is no longer reachable.

You are right. Personally I always free all memory before falling out of 
main(). 

Although after exiting from main() still lots of code is executed, returing 
from main() feels like the end of the program. Any pointer that can be reached 
at this point seems for me to be "still reachable". 

Altogether I wrote this example only because this is what I expect. I do not 
expect that anything is changed to fulfill that expectation.

Christoph

------------------------------------------------------------------------------
Crystal Reports &#45; New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty&#45;free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to