svn commit: r231282 - stable/9/include

Ed Schouten ed at FreeBSD.org
Thu Feb 9 15:28:29 UTC 2012


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


More information about the svn-src-all mailing list