Re: CURRENT: CLANG 3.3 and -stad=c++11 and -stdlib=libc++:

看板FB_current作者時間12年前 (2013/07/13 06:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串19/26 (看更多)
--Sig_/ZSAD9CXLaxRHx01iUtdTl3B Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Fri, 12 Jul 2013 12:13:58 -0500 Scot Hetzel <swhetzel@gmail.com> wrote: > On Fri, Jul 12, 2013 at 11:16 AM, Scot Hetzel <swhetzel@gmail.com> > wrote: > > On Thu, Jul 11, 2013 at 9:33 AM, David Chisnall > > <theraven@freebsd.org> wrote: > >> On 11 Jul 2013, at 13:11, Bruce Evans <brde@optusnet.com.au> wrote: > >> > >>> The error message for the __builtin_isnan() version is slightly > >>> better up to where it says more. > >>> > >>> The less-unportable macro can do more classification and detect > >>> problems at compile time using __typeof(). > >> > >> The attached patch fixes the related test cases in the libc++ test > >> suite. Please review. > >> > > > > #define fpclassify(x) \ > > - ((sizeof (x) =3D=3D sizeof (float)) ? __fpclassifyf(x) \ > > - : (sizeof (x) =3D=3D sizeof (double)) ? __fpclassifyd(x) \ > > - : __fpclassifyl(x)) > > + __fp_type_select(x, __fpclassifyf, __fpclassifyd, > > __fpclassifyd) > > > > The last __fpclassifyd should be __fpclassifyl. > > > I see it has already been fixed. >=20 >=20 Obviously not really fixed, but even worse: if I use in C code (C99, using clang 3.3 on FreeBSD 10.0-CURRENT/amd64 revision 253287) isnan(x) where x is a "const double", I receive now the following error (which doesn't appear on previous versions): [...] Making all in scaling /bin/sh ../../libtool --tag=3DCC --mode=3Dcompile cc -DHAVE_CONFIG_H -I. -I../.. -I. -I../ -I/usr/local/include -O0 -march=3Dnative -g -pipe -DHAVE_INLINE -g -O2 -MT libscaling_la-scalingTransientCroft.lo -MD -MP -MF .deps/libscaling_la-scalingTransientCroft.Tpo -c -o libscaling_la-scalingTransientCroft.lo `test -f 'scalingTransientCroft.c' || echo './'`scalingTransientCroft.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I. -I../ -I/usr/local/include -O0 -march=3Dnative -g -pipe -DHAVE_INLINE -g -O2 -MT libscaling_la-scalingTransientCroft.lo -MD -MP -MF .deps/libscaling_la-scalingTransientCroft.Tpo -c scalingTransientCroft.c -o libscaling_la-scalingTransientCroft.o scalingTransientCroft.c:48:12: error: controlling expression type 'const double' not compatible with any generic association type if (isnan(Dsg) || isnan(Dsc)) ^~~ /usr/include/math.h:109:19: note: expanded from macro 'isnan' __fp_type_select(x, __inline_isnanf, __inline_isnan, __inline_isnanl) ^ /usr/include/math.h:86:49: note: expanded from macro '__fp_type_select' #define __fp_type_select(x, f, d, ld) _Generic((x),=20 [...] The variables in question (Dsg and Dsc) are of type "const double". --Sig_/ZSAD9CXLaxRHx01iUtdTl3B Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQEcBAEBAgAGBQJR4HmNAAoJEOgBcD7A/5N8l/QH/35RmvVTNDC6a4uuInnSk27p eCprNuBQBFJvRVOAsNk22JmwNwH3MaKoSCbWQ8kaek0FMZiIL8CqZnujst+ONi5j 4rS5x1YTNlZrgl2vA/k0kdXbxXBb9gU7vbxGPGhwV+URo+zF5Fxbp/bq5+DIU+qQ 1sBGwv3gKFXsDqAUJ+Fhb/8u7V8NtyLwJLHlqVCpMFYMopeChw/936tATSeZZKkj iCU71toRC8ErBpVGQGHzhLde7GfI4RFhCJMPCFp/Iv/87Dia5DeGNz3xk35BzodG CF7sXwAowQJbv6ff4NLy/EfCxI6b0rZOrUQ7M8MvxKMh0MTt9bsomftaAwDGFB0= =/XUd -----END PGP SIGNATURE----- --Sig_/ZSAD9CXLaxRHx01iUtdTl3B--
文章代碼(AID): #1Hu7oVWf (FB_current)
討論串 (同標題文章)
完整討論串 (本文為第 19 之 26 篇):
文章代碼(AID): #1Hu7oVWf (FB_current)