Skip to content

Conversation

@sim642
Copy link
Member

@sim642 sim642 commented Dec 12, 2025

Closes #1767.

A normal return from main does not constitute an implicit pthread_exit which would cast the return value to void*: #1767 (comment).

According to pthread_exit man page, returning from a thread function implicitly calls pthread_exit only on non-main threads.
This avoids a strange cast (with overflow check) at normal return from main.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Thread return value cast causes weird unsigned integer underflow

2 participants