-
Notifications
You must be signed in to change notification settings - Fork 13
Make all longjmp
and pthread_exit
related behavior TBD
#31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Typo Co-authored-by: bjorn3 <[email protected]>
|
||
Conversely, if, due to a bug, `longjmp` were called unconditionally, then this | ||
code would have undefined behavior on all platforms when `c` is false, because | ||
`foo` would not be a POF. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect that the compiler would warn in this scenario, also
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm misunderstanding, but how would the compiler provide a warning for this? The extern
function is in C, so the compiler can't determine under what conditions it will longjmp
. Or do you mean it would warn in any scenario where a frame is not guaranteed to be a POF at the time it calls a "cancelable" function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean it would warn in any scenario where a frame is not guaranteed to be a POF at the time it calls a "cancelable" function?
This is what I meant. I think it's going to be quite rare that you have a function that sometimes cancels but you happen to know that on this particular call it will not and therefore you want to take advantage of that by having a pending destructor. In such a case, adding an #[allow]
annotation seems reasonable to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a comment to that effect
Per #30, the initial
"C unwind"
RFC will not specify whenlongjmp
andpthread_exit
is well-defined.