468,736 Members | 2,217 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,736 developers. It's quick & easy.

pgcc vs. gcc question - using <complex.h>

Hello, I have the following test program that I can compile with gcc,
but when I try to compile with the portland group compiler, pgcc, I
get a stream of errors.

#include <stdio.h>
#include <complex.h>

int main(int argc, char **argv){
complex double a={2.3+1.4*_Complex_I};
printf("a=%lf + i%lf\n",creal(a),cimag(a));
return 0;
}

I am able to use <complex> instead, and use the C++ complex class and
compile with pgCC, but since I eventually want to pass an array of
complex numbers to a Fortran function, this method is not appealing.
Is there some compiler directive that I need to use in order not to
get all of the errors?

Don
Nov 14 '05 #1
7 3818
dt*****@arlut.utexas.edu (Don Tucker) wrote in
news:5e**************************@posting.google.c om:
Hello, I have the following test program that I can compile with gcc,
but when I try to compile with the portland group compiler, pgcc, I
get a stream of errors.

#include <stdio.h>
#include <complex.h>


Is complex.h part of ISO C? If it's a gcc thing, you'd be better off
asking in one of the appropriate gnu newsgroups.

--
- Mark ->
--
Nov 14 '05 #2
Mark A. Odell wrote:
dt*****@arlut.utexas.edu (Don Tucker) wrote in
news:5e**************************@posting.google.c om:
Hello, I have the following test program that I can compile with gcc,
but when I try to compile with the portland group compiler, pgcc, I
get a stream of errors.

#include <stdio.h>
#include <complex.h>


Is complex.h part of ISO C? If it's a gcc thing, you'd be better off
asking in one of the appropriate gnu newsgroups.


It's part of C99.

Don, what sort of errors are you getting?

--
Russell Hanneken
rg********@pobox.com
Remove the 'g' from my address to send me mail.
Nov 14 '05 #3
"Mark A. Odell" wrote:
dt*****@arlut.utexas.edu (Don Tucker) wrote in
Hello, I have the following test program that I can compile with
gcc, but when I try to compile with the portland group compiler,
pgcc, I get a stream of errors.

#include <stdio.h>
#include <complex.h>


Is complex.h part of ISO C? If it's a gcc thing, you'd be better
off asking in one of the appropriate gnu newsgroups.


No, it's all quite valid. The only problem is that it needs a C99
compliant compiler, which pgcc appears not to be. He would have
found out (I think) with gcc if he used -ansi -pedantic which
restricts to C90. He could also have used --std=C99 -pedantic and
had things work.

Minimum gcc flags for portability: -W -Wall -ansi -pedantic

--
Chuck F (cb********@yahoo.com) (cb********@worldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!
Nov 14 '05 #4
CBFalconer <cb********@yahoo.com> wrote in
news:40***************@yahoo.com:
> #include <complex.h>


Is complex.h part of ISO C? If it's a gcc thing, you'd be better
off asking in one of the appropriate gnu newsgroups.


No, it's all quite valid. The only problem is that it needs a C99
compliant compiler, which pgcc appears not to be. He would have


I learn something new everyday. Thanks.

--
- Mark ->
--
Nov 14 '05 #5
CBFalconer wrote:
No, it's all quite valid. The only problem is that it needs a C99
compliant compiler, which pgcc appears not to be.


Perhaps PGCC ships without a C99 library. Comeau C/C++ is advertised as
having "amazing C99 support," but is dependent on something like Dinkum
for full C99 support.
Nov 14 '05 #6
Jon Willeke wrote:
CBFalconer wrote:
No, it's all quite valid. The only problem is that it needs a C99
compliant compiler, which pgcc appears not to be.

Perhaps PGCC ships without a C99 library. Comeau C/C++ is advertised as
having "amazing C99 support," but is dependent on something like Dinkum
for full C99 support.


Both Comeau and Dinkum are commercial things and cost a little money.
Greg and PJ are apparently cooperating to provide a C99 compiler product
to those who want it. What's the problem with Comeau + Dinkum?

--
Joe Wright mailto:jo********@comcast.net
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---
Nov 14 '05 #7
in comp.lang.c i read:
CBFalconer wrote:

No, it's all quite valid. The only problem is that it needs a C99
compliant compiler, which pgcc appears not to be.


Perhaps PGCC ships without a C99 library.


which makes it non-conforming for a hosted impementation.

--
a signature
Nov 14 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Donald Firesmith | last post: by
2 posts views Thread by Peng Yu | last post: by
17 posts views Thread by Julian V. Noble | last post: by
3 posts views Thread by ajay2552 | last post: by
5 posts views Thread by jeremit0 | last post: by
7 posts views Thread by huili80 | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.