[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-hackers] [PATCH] Use noreturn attribute in clang versions which
[Chicken-hackers] [PATCH] Use noreturn attribute in clang versions which support it
Mon, 21 Oct 2013 22:27:55 +0200
Here's another small patch which will properly enable C_noret for clang.
Currently it expands to nothing and causes a slew of warnings mostly
because it doesn't understand that barf() won't return when it detects
an error, and that will leave many variables uninitialised. Luckily,
clang has nice feature checking macros (builtins) which allow you to
detect which features are available. Damn, clang is nice!
Anyway, I've added a __has_attribute definition for other compilers
so they won't die on #if defined(__clang__) && !__has_attribute(noreturn)
Not adding this would further complicated the logic, I think.
Fixing this got rid of all the warnings, except one, which exposed
a small bug which is also a minor inefficiency: C_2_divide will call
C_fix() on an integer value, which in case of flonums will not be
initialised. In cases of flonums, it will be initialised, but it will
get C_fix()ed and immediately C_unfix()ed afterwards. This is
unnecessary and wrong, so I've moved the C_fix() call to occur after
Perhaps this patch can also go into stability. It's not important,
but probably a good idea so users compiling with clang won't get
Sorry if this mail is a little rambling, I'm slightly ill right now.
Description: Text document