Calypsi-tool-chains icon indicating copy to clipboard operation
Calypsi-tool-chains copied to clipboard

Feature request: __attribute__((cleanup(cleanup_function)))

Open KyleCardoza opened this issue 1 year ago • 2 comments

From the GCC manual:

The cleanup attribute runs a function when the variable goes out of scope. This attribute can only be applied to auto function scope variables; it may not be applied to parameters or variables with static storage duration. The function must take one parameter, a pointer to a type compatible with the variable. The return value of the function (if any) is ignored.

I personally think this is a really useful thing to have, I use it all the time, and it would be wonderful to have in Calypsi, if it's not too much work.

KyleCardoza avatar May 30 '23 22:05 KyleCardoza