Unfortunately, this requires an executable stack, and only works on gcc, though an alternate implementation can work on clang. After a few attempts at defer, I ended up using a cleanup macro that just takes a function and a value to pass to it: https://github.com/aws-greengrass/aws-greengrass-lite/blob/8... Since the attribute or a function-like macro in the attribute position broke the c parsing in some tooling, I m…
It does not need an executable stack: https://godbolt.org/z/K1GTa4jh4
https://thephd.dev/lambdas-nested-functions-block-expression...