void clean(__attribute__((unused)) int * p) {} extern int bar(int); int foo(int x) { int i __attribute__((cleanup(clean))); return bar(x); }