On 26 Oct 2013, at 20:18, Raphael Kubo da Costa <rak...@freebsd.org> wrote:

> Raphael Kubo da Costa <rak...@freebsd.org> writes:
> 
>> David Chisnall <thera...@freebsd.org> writes:
>> 
>>> Author: theraven
>>> Date: Fri Jul 12 11:03:51 2013
>>> New Revision: 253260
>>> URL: http://svnweb.freebsd.org/changeset/base/253260
>>> 
>>> Log:
>>>  Fix the build with C++ where __builtin_types_compatible_p is not allowed.
>>> 
>>> Modified:
>>>  head/lib/msun/src/math.h
>>> 
>>> Modified: head/lib/msun/src/math.h
>>> ==============================================================================
>>> --- head/lib/msun/src/math.h        Fri Jul 12 10:07:48 2013        
>>> (r253259)
>>> +++ head/lib/msun/src/math.h        Fri Jul 12 11:03:51 2013        
>>> (r253260)
>>> @@ -81,12 +81,13 @@ extern const union __nan_un {
>>> #define     FP_SUBNORMAL    0x08
>>> #define     FP_ZERO         0x10
>>> 
>>> -#if __STDC_VERSION__ >= 201112L && defined(__clang__)
>>> +#if (__STDC_VERSION__ >= 201112L && defined(__clang__)) || \
>>> +    __has_extension(c_generic_selections)
>>> #define     __fp_type_select(x, f, d, ld) _Generic((x),     \
>>>     float: f(x),                                    \
>>>     double: d(x),                                   \
>>>     long double: ld(x))
>> 
>> One of the things that's making cad/brlcad fail with clang is some C
>> code that calls isnan() and isinf() with -std=gnu89, -Werror and
>> -Wc11-extensions:
> 
> (To be fair, it's -pedantic that brings in -Wc11-extensions)

The issue is probably a clang bug.  The use of _Generic() is in a system header 
and so ought to be immune to warnings, but apparently the fact that it's 
instantiated outside of the system header.  If you can file a clang bug 
(http://llvm.org/bugs/enter_bug.cgi?product=clang) I'll take a look (I'm at 
vBSDCon now, so I'll lose it otherwise).

Ports definitely shouldn't be using -Werror though.  I've heard -Werror 
described as the flag meaning 'fail to compile with any newer compiler than the 
one I'm using' - it's a great idea for trunk, but it should be turned off for 
releases.  Sticking -Wno-error on the end will fix it.

David

_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to