Project

General

Profile

Bug #3880

gcc doesn't like complex.h

Added by Alexander Pyhalov about 7 years ago. Updated 11 months 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

History

#1

Updated by Rich Lowe about 7 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.

#2

Updated by Alexander Pyhalov about 7 years ago

I applied the following patch in oi-hipster. It seems to fix complex.h (at least imagemagick can use it).

#3

Updated by Robert Mustacchi over 5 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.

#4

Updated by Alexander Pyhalov over 5 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100

Confirm this

#5

Updated by Robert Mustacchi 11 months ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF