Bug #3880
closedgcc doesn't like complex.h
100%
Description
The following test case works with Sun Studio cc but fails with gcc (checked illumos-gcc and 4.7):
$ cat test_complex.c
#include <complex.h>
int main()
{
double complex f;
f=5+I*2;
return 0;
}
$ gcc test_complex.c
test_complex.c: In function ‘main’:
test_complex.c:7:5: error: ‘_Imaginary_I’ undeclared (first use in this function)
test_complex.c:7:5: note: each undeclared identifier is reported only once for each function it appears in
$ cc test_complex.c
A comment in complex.h says:
/*
* Compilation environments for Solaris must provide the _Imaginary datatype
* and the compiler intrinsics _Complex_I and _Imaginary_I
*/
It seems that gcc doesn't do this. GCC project fixed this issue with fix_includes.
Files
Updated by Rich Lowe almost 9 years ago
I think this is yet another thing that is, right now, in libm (and thus not illumos)
I think I actually fixed this when allowing libm to build with gcc, but I'm not certain.
Updated by Alexander Pyhalov almost 9 years ago
I applied the following patch in oi-hipster. It seems to fix complex.h (at least imagemagick can use it).
Updated by Robert Mustacchi about 7 years ago
It looks like this was fixed as part of the libm integration. The test case in question passes for me without fixincludes with the newer libm.
Updated by Alexander Pyhalov about 7 years ago
- Status changed from New to Feedback
- % Done changed from 0 to 100
Confirm this
Updated by Robert Mustacchi almost 3 years ago
- Status changed from Feedback to Closed