Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
KyleCardoza opened this issue May 30, 2023 · 2 comments
Open

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

KyleCardoza opened this issue May 30, 2023 · 2 comments

Comments

@KyleCardoza
Copy link

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.

@hth313
Copy link
Owner

hth313 commented May 31, 2023

I had some hope this would be trivial, but it turns out that I only get an attribute from the front end and have to deal with it on my own. It is hard to say how much work it will be, not trivial, but hopefully not too bad. I have put it on the list of things to look at during the coming weeks.

@KyleCardoza
Copy link
Author

No worries, it's more a "would be nice to have" than a "must absolutely have".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants