Actions
Bug #3880
closedgcc doesn't like complex.h
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2013-07-11
Due date:
% Done:
100%
Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:
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
Actions