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

--- Comment #5 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #3)
> (In reply to comment #0)
> > I would like to have a warning in C++ that warns about local variables 
> > assigned
> > via operator new or operator new[], but then are not freed in an exception
> > handling clause in case of an exception.
> 
> Simple solution: don't do that. Ever.
> 

That's easy enough advice to follow if you're writing code yourself, however,
it isn't very helpful for compiling other people's code who ignored that advice
and wrote such code anyways.

> Then you don't need a compiler warning.
> 
> If you insist on writing such code the cppcheck tool can issue the sort of
> warning you want (but it gives lots of false positives too).

Reply via email to