https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115689

--- Comment #5 from anlauf at gcc dot gnu.org ---
(In reply to Jerry DeLisle from comment #4)
> (In reply to kargls from comment #3)
> > The code you posted is standard conforming, and when
> > compiled, executes as expected.
> > 
> > My point is that the program is exiting.  The operate system will
> > reap the process and reclaim the memory.  Valgrind need not warn
> > about this.  It is just noise.  It is not a memory leak.  If anything
> > it is poor programming on the part of the person that wrote the
> > code, and arguably a bug the code.
> > 
> 
> I agree completely, I would prefer that programmers explicitly deallocate.

That's what I do in runtime tests (unless I forget to).

> I simply do not know what our expectations should be when testing.  Maybe in
> this case it is a don't care. I posted the question for clarification from
> others.

Running the program from comment#0 - compiled with ifx - under valgrind
gives here:

==12826== HEAP SUMMARY:
==12826==     in use at exit: 60 bytes in 1 blocks
==12826==   total heap usage: 13 allocs, 12 frees, 12,926 bytes allocated
==12826== 
==12826== LEAK SUMMARY:
==12826==    definitely lost: 0 bytes in 0 blocks
==12826==    indirectly lost: 0 bytes in 0 blocks
==12826==      possibly lost: 60 bytes in 1 blocks

But as Steve pointed out: this is irrelevant, just a hint to the programmer.

Reply via email to