Discussion:
[PATCH] macOS: noreturn.
Add Reply
Rob Landley
2018-11-29 00:52:40 UTC
Reply
Permalink
The macOS libc headers use `__attribute__((noreturn))` rather than
`__attribute__((__noreturn__))`, so toybox's `noreturn` macro trips them
up. Since we already have a variety of uses of `__attribute__` that
aren't guarded in this way, let's do the same here.
It was for compilers that didn't have attribute(__noreturn__) (the kernel did
this for really old gcc versions, and once upon a time I maintained a tinycc
fork...) but it looks like C11 added some variant of it as standard:

https://en.cppreference.com/w/c/language/_Noreturn

And I guess C11 has hit the 7 year support horizon from the FAQ. (First thing
I've found from C11 that might actually be worth depending on. Which would be a
syntax migration but there's no rush, pretty sure this is not our only gcc
extension and what's an interesting compiler that doesn't have those extensions?)

Rob

Loading...