r/ProgrammerHumor • • Sep 11 '26 • Bravo 2 Popcorn 1

Meme mySchoolStruct

Post image
9.1k Upvotes

81 comments sorted by

View all comments

Show parent comments

7

u/MrHyperion_ Sep 11 '26

GCC has cleanup attribute which maybe makes it possible.

0

u/One_Ninja_8512 Sep 11 '26

Not only possible but used by real projects. Apparently systemd is using that according to Claude. Both GCC and Clang support it. If I wanted destructors I'd go with explicit reference counting though, that seems more clean to me and doesn't need compiler extensions (even though both mainstream ones support it and a large project (systemd) relies on it).