Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intel C Compiler fails to compile test/ccalltest.c due to the presence of complex integer literals #10471

Closed
psanan opened this issue Mar 11, 2015 · 4 comments

Comments

@psanan
Copy link

psanan commented Mar 11, 2015

During a (re)build, I encountered a "1909: complex integral types are not supported" error when using the intel C compiler (icc 14.0.2 20140120 ).

The build proceeds normally if the following changes are made (from b299179)

diff --git a/test/ccalltest.c b/test/ccalltest.c
index 0b6155f..0972aeb 100644
--- a/test/ccalltest.c
+++ b/test/ccalltest.c
@@ -118,28 +118,28 @@ complex_t ctest(complex_t a) {
 complex double cgtest(complex double a) {
     //Unpack a ComplexPair{Float64} struct
     if (verbose) fprintf(stderr,"%g + %g i\n", creal(a), cimag(a));
-    a += 1 - 2i;
+    a += 1 - (2.0*I);
     return a;
 }

 complex double* cgptest(complex double *a) {
     //Unpack a ComplexPair{Float64} struct
     if (verbose) fprintf(stderr,"%g + %g i\n", creal(*a), cimag(*a));
-    *a += 1 - 2i;
+    *a += 1 - (2.0*I);
     return a;
 }

 complex float cftest(complex float a) {
     //Unpack a ComplexPair{Float32} struct
     if (verbose) fprintf(stderr,"%g + %g i\n", creal(a), cimag(a));
-    a += 1 - 2i;
+    a += 1 - (2.0*I);
     return a;
 }

 complex float* cfptest(complex float *a) {
     //Unpack a ComplexPair{Float64} struct
     if (verbose) fprintf(stderr,"%g + %g i\n", creal(*a), cimag(*a));
-    *a += 1 - 2i;
+    *a += 1 - (2.0*I);
     return a;
 }
@psanan psanan changed the title Intel C Compiler fails to compile test/ccalltests.c due to the presence of complex integer literals Intel C Compiler fails to compile test/ccalltest.c due to the presence of complex integer literals Mar 11, 2015
@jakebolewski
Copy link
Member

Fixed in a more recent version of the compiler?

https://software.intel.com/en-us/articles/error-1909-complex-integral-types-are-not-supported

@psanan
Copy link
Author

psanan commented Mar 11, 2015

I seem to have version 14.0.2 which is later than the purported fix in that link (10.1.031).

@psanan
Copy link
Author

psanan commented Mar 24, 2015

I have also left a note on the commit which closes this issue, but one instance of 2i remains in ccalltest.c, which I needed to convert to (2.0)*I to build with the intel compiler mentioned above.

ivarne added a commit that referenced this issue Mar 24, 2015
Asked for by @psanan in #10471

Seems pretty obvious and safe to me.
@ivarne
Copy link
Sponsor Member

ivarne commented Mar 24, 2015

I think 03da3a3 should fix the issue. @psanan Can you confirm?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants