- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
#include <stdio.h>
#include <stdlib.h>
void myfree(void *ptr)
{
printf("%p\n", *(void **)ptr);
free(*(void **)ptr);
printf("freed!\n");
}
int main(void) {
char *x __attribute__ (( cleanup (myfree) )) = malloc(1);
printf("%p\n", x);
return 0;
}