#include struct obj1 { struct obj1 *next; }; struct obj2 { struct obj2 *next; }; void allocate(struct obj1 *sym) { struct obj2 *head = 0; for (; sym; sym = sym->next) { struct obj2 **p, *n; for (p = &head; *p; p = &(*p)->next) if (sym->next) break; n = alloca(sizeof(*n)); n->next = *p; *p = n; } }