소스 검색

make the result of the cimag macro a non-lvalue

this change is not necessary but helps diagnose invalid code. based on
patch by Jens Gustedt.
Rich Felker 10 년 전
부모
커밋
4075af4318
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      include/complex.h

+ 1 - 1
include/complex.h

@@ -103,7 +103,7 @@ long double creall(long double complex);
 
 #ifndef __cplusplus
 #define __CIMAG(x, t) \
-	((union { _Complex t __z; t __xy[2]; }){(_Complex t)(x)}.__xy[1])
+	(+(union { _Complex t __z; t __xy[2]; }){(_Complex t)(x)}.__xy[1])
 
 #define creal(x) ((double)(x))
 #define crealf(x) ((float)(x))