[libc-commits] [libc] [libc] Provide sys/queue.h (PR #78081)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Wed Jan 17 09:00:15 PST 2024


nickdesaulniers wrote:

> > At the very least, please add support for `STAILQ_LAST`; there's quite a few places that you could use it in the stailq implementation (as you do for `STAILQ_HEAD`)
> 
> I initially planned to to use `STAILQ_LAST` in the `STAILQ` implementation akin to `STAILQ_FIRST`, but it doesn't work. The problem is that `last` inside the head `struct` is a pointer to a pointer, `STAILQ_LAST` in existing implementations returns just a pointer (which requires some non-trivial pointer arithmetic). I don't want to change the `STAILQ_LAST` semantics because that could break existing code. I considered introducing `__STAILQ_LAST` instead but I'm not sure if it's worth it?

Ah, yeah in that case nevermind my earlier suggestion.

https://github.com/llvm/llvm-project/pull/78081


More information about the libc-commits mailing list