Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Feb 2012 15:28:28 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r231282 - stable/9/include
Message-ID:  <201202091528.q19FSSnX007295@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed
Date: Thu Feb  9 15:28:28 2012
New Revision: 231282
URL: http://svn.freebsd.org/changeset/base/231282

Log:
  MFC r229590 manually:
  
    It turns out our GCC has quite an interesting bug:
  
          typeof(1.0fi) != float _Complex
          typeof((float _Complex)1.0fi) != float _Complex
          typeof((float _Complex)1.0i) == float _Complex
  
    In other words: if casting to an equal size, GCC seems to take a
    shortcut. By casting down from a double to a float, GCC doesn't take
    this shortcut, yielding the proper type.

Modified:
  stable/9/include/complex.h

Modified: stable/9/include/complex.h
==============================================================================
--- stable/9/include/complex.h	Thu Feb  9 15:26:47 2012	(r231281)
+++ stable/9/include/complex.h	Thu Feb  9 15:28:28 2012	(r231282)
@@ -33,7 +33,7 @@
 #if __STDC_VERSION__ < 199901
 #define	_Complex	__complex__
 #endif
-#define	_Complex_I	1.0fi
+#define	_Complex_I	((float _Complex)1.0i)
 #endif
 
 #define	complex		_Complex



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