#655 closed defect (fixed)
'complex' type declaration should be changed to 'double complex'
| Reported by: | jhoblitt | Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | types | Version: | 0.9.0 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
Under C99 'complex' is short hand for 'float complex' but the SDRS assumes that
'complex' means 'double complex'. This has been fixed in the SDRS and I'll be
sending out a new API delta shortly.
Change History (12)
comment:1 by , 20 years ago
| Owner: | changed from to |
|---|
comment:2 by , 20 years ago
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
comment:3 by , 20 years ago
| Cc: | added |
|---|---|
| Resolution: | invalid |
| Status: | closed → reopened |
Have you tried that with a complier other then gcc? In fact, if you enable
'-pedantic' with gcc it will tell you it is doing the wrong thing under ISO C by
defining 'complex' to mean 'double complex'.
If you can you point to the section of the c99 spec that defines 'complex' as
'double _Complex' you can remark this bug as invalid. Otherwise it is a gcc
specific behavior and a bug that needs to be fixed.
comment:4 by , 20 years ago
| Status: | reopened → assigned |
|---|
The C99 specification seems to be fairly silent on what the correct behavior is here. I also know that GCC
has serious problems in places if we just replace 'complex' with 'complex double', strangely enough, so it
is not trivial to do what you ask either.
Well look into this further.
-rdd
comment:6 by , 20 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
I guess Robert fixed this.
comment:7 by , 20 years ago
| Resolution: | fixed |
|---|---|
| Status: | closed → reopened |
This has not been fixed in head.
$ grep -R "double complex" src | wc -l
0
comment:8 by , 20 years ago
| Resolution: | → fixed |
|---|---|
| Status: | reopened → closed |
I get 27.
I apologize ahead of time if I'm confused, but I believe this has been done.
comment:9 by , 20 years ago
I concur.
price@mithrandir:/home/mithrandir/price/psLib/psLib_head>grep -R "double
complex" src | wc -l
27

Actually, under C99, 'complex' is short hand for 'double _Complex'. If you want proof, try the following
program:
#include<stdio.h>
#include<complex.h>
int main(void) {
}