Examples from the link:
struct Header* head = calloc(1, sizeof(struct Header) + data_size);
head->type = type;
Head is not checked for null. This will segfault when heap allocations fail. [Preemptive reply to folks used to high-level languages and the Linux overcommit behavior: yes, heap allocations do fail, and yes, it is possible to handle such a failure well.] typedef void* var;
// ...
return ((var)head) + sizeof(struct Header);
It's illegal to do pointer arithmetic on void pointers. You need to cast to another type first. #define alloc_stack(T) header_init( \
(char[sizeof(struct Header) + sizeof(struct T)]){0}, T)
That's going to crash when you try to access the T on many non-x86 architectures. On x86 you will have subtle problems like atomic ops failing to work.I have seen cello come up on HN before. Seems like a cute hobby project based on some kind of flawed ideas of what "C" is. If people interested in learning C are reading, I suggest learning C "for realsies" and avoiding this thing.