473,499 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4109
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
10534
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script...
2
1748
by: Peng Yu | last post by:
http://www.digitalmars.com/rtl/complex.html The above the specification of complex.h, but it seem that g++(3.3) hasn't fully support it yet. I wonder where I can find the specifications of...
2
9768
by: Arvid Requate | last post by:
Hello, I'd like to understand why the following code does not compile. It looks like a strangeness in connection with overload resolution for the <complex> header: The conversion operator...
17
3702
by: Julian V. Noble | last post by:
Dear C Mavens, I am writing a Computing Prescription for CiSE on complex arithmetic. I would like to be sure that I do not include any gaffes about C99--especially about what is in the header...
3
6128
by: J.M. | last post by:
I have data in a double array of length 2N, which actually represents complex numbers with real and imaginary parts interlaced. In other words, elements in this array with even indices represents...
3
3345
by: ajay2552 | last post by:
Hi, I have a query. All html tags start with < and end with >. Suppose i want to display either '<' or '>' or say some text like '<Company>' in html how do i do it? One method is to use &lt,...
5
6031
by: jeremit0 | last post by:
I'm trying to sort a vector<complex<double and can't figure it out. I recognize the problem is that there isn't a default operator< for complex data types. I have written my own operator and can...
7
2609
by: huili80 | last post by:
Should complex<T>::real() and imag() return a value or a refernce? What does the standard say about this? I just realized that MSVC2008's implementation returns a value, but in GCC reference is...
0
7009
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7223
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7390
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5475
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4919
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4602
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3094
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
302
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.