-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Mark functions that never return as noreturn #8
Conversation
Silences a few static analysis complaints
I think there's the usual portability issue here, and probably the usual C-preprocessor solution. |
I am still not sure I completely understand the portability issue here because attribute noreturn is supported by both Gcc, clang and msvc afaik. Do you have a compiler where this fails? If so, I would like to reproduce it. |
Also, is there a minimum C standard we have to support? Are we still only supporting C99 or C11 is the minimum at this point? Maybe CI should enforce this by using one of the std compiler flags. |
I thought we concluded in racket/racket#2472 that enabling via But then there was racket/racket#2496 where I found that compilers can't always verify the annotation, so we made it enabled only via a command-line preprocessor flag. So, maybe the same thing as racket/racket#2496 is right here? |
That's right, however I never really reproduced those issues locally. I want to do so because the previous patches felt a bit like hacks since it telling the compiler that a function doesn't return allows the C compiler to perform optimizations that are otherwise skipped and therefore having this even outside CI could be a benefit. |
The
I'm be interested if there's really a performance benefit. It seems possible that the GC could go a little faster if the slow path for an abort somehow interferes with the normal path, but I'll be surprised. |
Hold on to this PR. I will not only try to find a better solution than we currently have but time results with and without noreturn. |
Right, I got myself a windows machine early this morning and I can confirm that you're right. I did assume, incorrectly, that MSVC would have implemented this by now. :( |
@pmatos did all the work here in racket#8 and racket/racket#2344.
Time to close this after you committed 2e3a618. Thanks! |
@pmatos did all the work here in racket/ChezScheme#8 and racket#2344. original commit: 2e3a618b0072d547b6c5abe6dd8dbac36a98c10e
@pmatos did all the work here in #8 and racket/racket#2344.
@pmatos did all the work here in racket#8 and racket/racket#2344. Original commit: racket/ChezScheme@1dc8b71
@pmatos did all the work here in racket#8 and racket/racket#2344. Original commit: racket/ChezScheme@28c083a
Silences a few static analysis complaints