Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Oct 2013 03:13:18 +0300
From:      Raphael Kubo da Costa <rakuco@FreeBSD.org>
To:        David Chisnall <theraven@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r253260 - head/lib/msun/src
Message-ID:  <86d2mrd10h.fsf@orwell.Elisa>
In-Reply-To: <201307121103.r6CB3qrh068782@svn.freebsd.org> (David Chisnall's message of "Fri, 12 Jul 2013 11:03:52 %2B0000 (UTC)")
References:  <201307121103.r6CB3qrh068782@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
David Chisnall <theraven@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:

  /s/brlcad/src/libbn/ulp.c:170:9: error: generic selections are a C11-specific feature [-Werror,-Wc11-extensions]
      if (isnan(val) || isinf(val))
          ^
  /usr/include/math.h:118:2: note: expanded from macro 'isnan'
          __fp_type_select(x, __inline_isnanf, __inline_isnan, __inline_isnanl)
          ^
  /usr/include/math.h:86:39: note: expanded from macro '__fp_type_select'
  #define __fp_type_select(x, f, d, ld) _Generic((x),                     \
                                        ^

Can the check there be improved somehow to avoid this kind of error?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86d2mrd10h.fsf>