On 08/12/2011 04:41 AM, Rich Felker wrote:
On Fri, Aug 12, 2011 at 04:45:58AM +0200, Luka Marčetić wrote:
alloc.c
So we're on the same page, is the latest version in git what you're
looking at? I'll take a look..

No, it was attached to the mail. Will commit though.

Both musl and glibc macros generate invalid code for this one, it
ends with `do {;` in both cases iirc. Strange - what is it?
You might want to read this:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_cleanup_pop.html

There's even a sample implementation in the rationale.

Rich

What I read was:

"The thread exits (that is, calls pthread_exit())."

Then I clicked the link (http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_exit.html), hoping to find this:

"An implicit call to pthread_exit() is made when a thread other than the thread in which main() was first invoked returns from the start routine that was used to create it."

And when I did, I've overlooked '{', expecting an '}'. I regard this as slight inconsistency in the standard. At least it's missing the word "explicitly", but I'd reword it altogether hehe.
Anyway, I'll just cast the void* to a function pointer and call it directly.
Thanks.
Luka