Re: [patch 2/2] Assert leftover cleanups in TRY_CATCH

Tom Tromey
2013-05-07T14:40:37Z

Joel> Should we consider changing it into an internal_warning?

I think that is fine as long as it still makes tests fail.

Tom> I think it would be possible to automate adding this declaration in
Tom> all needed spots. I'm curious what you think about it.

Joel> I'm certainly curious about the suggestion. How would the current
Joel> code be adapted to make this work?

Well, first a manual patch both to define this macro appropriately and
to add whatever supporting functions are needed.

Then, modify the cleanup checker to add this declaration to any function
it thinks could use it. The cleanup checker already has some code,
written in a more optimistic time, to try to determine whether a
function could be converted to "RAII style". It could be adapted to
insert the macro use at the right spot.

Then, rebuild and fix whatever bugs were introduced.

Finally, update our patch review guidelines so we know to look for this
macro in ordinary cleanup-using functions.

Alternatively I think we could probably change all the code to be
cleanup-checker-clean. I'll try to prep that series soon to see what
people think. I think it actually less work.

Tom