Project

General

Profile

Actions

Bug #3880

closed

gcc doesn't like complex.h

Added by Alexander Pyhalov almost 9 years ago. Updated almost 3 years ago.

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.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41169


Files

complex.h_Imaginary_I.patch (1.15 KB) complex.h_Imaginary_I.patch Alexander Pyhalov, 2013-07-12 04:09 AM
Actions

Also available in: Atom PDF