IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Opened 20 years ago

Closed 20 years ago

Last modified 20 years ago

#655 closed defect (fixed)

'complex' type declaration should be changed to 'double complex'

Reported by: jhoblitt Owned by: David.Robbins@…
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 robert.desonia@…, 20 years ago

Owner: changed from robert.desonia@… to David.Robbins@…

comment:2 by robert.desonia@…, 20 years ago

Resolution: invalid
Status: newclosed

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) {

printf("sizeof(complex)=%i\n",sizeof(complex));
printf("sizeof(float complex)=%i\n",sizeof(float complex));
printf("sizeof(double complex)=%i\n",sizeof(double complex));

return 0;

}

comment:3 by jhoblitt, 20 years ago

Cc: eugene@… added
Resolution: invalid
Status: closedreopened

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 robert.desonia@…, 20 years ago

Status: reopenedassigned

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 David.Robbins@…, 20 years ago

Resolution: fixed
Status: assignedclosed

I guess Robert fixed this.

comment:7 by jhoblitt, 20 years ago

Resolution: fixed
Status: closedreopened

This has not been fixed in head.

$ grep -R "double complex" src | wc -l
0

comment:8 by David.Robbins@…, 20 years ago

Resolution: fixed
Status: reopenedclosed

I get 27.
I apologize ahead of time if I'm confused, but I believe this has been done.

comment:9 by Paul Price, 20 years ago

I concur.

price@mithrandir:/home/mithrandir/price/psLib/psLib_head>grep -R "double
complex" src | wc -l

27

comment:10 by jhoblitt, 20 years ago

Looks like I was caught by Gene's CVS tree reorganization.

comment:11 by Paul Price, 20 years ago

Keywords: VERIFIED added

Bug has been resolved.... closing.

comment:12 by Paul Price, 20 years ago

Keywords: VERIFIED removed

Bugs have been fixed... closing.

Note: See TracTickets for help on using tickets.