473,625 Members | 3,330 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*_Com plex_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 4119
dt*****@arlut.u texas.edu (Don Tucker) wrote in
news:5e******** *************** ***@posting.goo gle.com:
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.u texas.edu (Don Tucker) wrote in
news:5e******** *************** ***@posting.goo gle.com:
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********@pobo x.com
Remove the 'g' from my address to send me mail.
Nov 14 '05 #3
"Mark A. Odell" wrote:
dt*****@arlut.u texas.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********@yah oo.com) (cb********@wor ldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net> USE worldnet address!
Nov 14 '05 #4
CBFalconer <cb********@yah oo.com> wrote in
news:40******** *******@yahoo.c om:
> #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
10555
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 type="text/javascript"> <!]> </script> <script type="text/javascript"
2
1752
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 complex.h supported by old version g++ (say 2.95.4). Peng
2
9781
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 double() of class B is called for the member complex::operator*=(double) as expected, but not for operator*(complex, double). The effect is, that the template matching (or overload resolution)
17
3718
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 file <complex.h. I have Googled <complex.hand got about 177K hits, which I obviously do not wish to go through one at a time. I also tried "<complex.hsource" but still got Does anyone know where I can get a complete, definitive and
3
6153
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 the real part of a complex number, elements with odd indices represent the imaginary part. I actually need an array of length N of type complex<double>. Obviously, I could copy the data and destroy the first array, but this is an expensive option....
3
3366
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, &gt ,&ltCompany&gt to display '<', '>' and '<Company>' respectively. But is there any freeware code available which could implement the above functionality without having to use &gt,&lt and such stuff???
5
6044
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 use it, but std::sort doesn't seem to find it. I have copied a very simple example below. Everything compiles just fine when the line with std::sort function is commented out, but with that line included a whole slew of errors are given like: ...
7
2617
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 returned. I tend to believe that MSVC made a big mistake here!!! But unfortunately I must use it at work, which sucks!!!
0
8256
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8189
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8694
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8635
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8356
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8497
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4193
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2621
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 we have to send another system
1
1803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.