Compliant compiler? Comeau?

N

nicdude

why not ask Comeau directly

We did, and they answered, but wanted general responses too though.
Am asking generally about compliant compilers too, say for UNIX, they
don't seem to exist?
 
R

Robert W Hand

There is a Comeau C++ compiler special offer at
http://www.comeaucomputing.com Is it really as compliant as it seems
to imply? In terms of Standard C++, what is it missing? Can it
handle templates well?

Your question requires a rather complex answer. Herb Sutter pulled
together a "roundup" about C++ compiler conformance several years ago.
The reference is below. I'm not sure if any compiler has made great
strides since the roundup. So it is still worthwhile reading. Please
note that the Comeau compiler is mentioned in some detail.

http://www.cuj.com/documents/s=8193/cuj0104sutter/

I have used Comeau for a number of years. I have found Greg to be
honest and helpful in his correspondence. The compiler is pretty good
with compliance. I think that it handles templates well. Much of the
noncompliance problems, that I have encountered, involve the legacy
library that I use to back-end his compiler. Comeau has no control
over the legacy library, of course. But on balance, it has not been
that much of a problem. I would recommend the product.
 
D

Dave

nicdude said:
We did, and they answered, but wanted general responses too though.
Am asking generally about compliant compilers too, say for UNIX, they
don't seem to exist?

For Solaris and Linux, take a look at Sun Studio 11, which is now a free
download (a large one, at well over 200 MB).

On SPARC it certainly generates better (faster) code than gcc and I
believe it certainly does not extend the languages the was gcc does.

--
Dave K

http://www.southminster-branch-line.org.uk/

Please note my email address changes periodically to avoid spam.
It is always of the form: month-year@domain. Hitting reply will work
for a couple of months only. Later set it manually. The month is
always written in 3 letters (e.g. Jan, not January etc)
 
N

nicdude

But gcc is not compliant and Studio 11 does not appear to be compliant,
which is my subject.
 
D

Dave

nicdude said:
But gcc is not compliant and Studio 11 does not appear to be compliant,
which is my subject.
I know gcc is not compliant.

Is studio 11 not compliant? You surprise me there.

My own experience for what it worth, is there is nothing like testing
software on various architectures to find bugs and portability issues.

One of my programs has been tested on just about everything from a Sony
Playstation 2 games console to a Cray Supercomputer. In between them,
there has been PCs running just about every OS you can think of
(including Windoze), Suns running Solaris, SGI Octane running IRIX, Dec
Alpa running Tru64, HP C3000 running HP-UX, IBM/6000 running AIX and so
on. If you can test your code on all those machines and find it compiles
OK, you can be pretty sure it is portable. Where possible I have avoided
the use of gcc, but of course that is not always possible.

The Cray was the biggest headache, with sizeof(short)=8. Having short,
int and long all 8 bytes is a bit tricky if you write binary files.

I don't claim my code (which I would add is C not C++) is compliant with
the ANSI (or any other) C standard, but it does compile and build on any
machine I can find, with any modern(ish) compiler I can find.

--
Dave K

http://www.southminster-branch-line.org.uk/

Please note my email address changes periodically to avoid spam.
It is always of the form: month-year@domain. Hitting reply will work
for a couple of months only. Later set it manually. The month is
always written in 3 letters (e.g. Jan, not January etc)
 
H

Howard Hinnant

Dave
<INVALID-see-signature-for-how-to-determine@southminster-branch-line.or
I know gcc is not compliant.

Fwiw, the gcc 4.x C++ FE is fairly impressive in the compliance
department (a giant step forward from gcc 3.x). I admit that I'm not
yet intimately familiar with the gcc 4.x FE, but my impression to date
is pretty favorable. It obviously lacks export (Comeau is the only
shipping compiler I'm aware of that supports export). The gcc 4.0 FE
also supports an extension that allows zero length arrays in some
circumstances, and I've stumbled across a place or two where this
extension is in conflict with a simple implementation of static assert
(use BOOST_STATIC_ASSERT to avoid such problems). Other than these two
issues, I'm not currently aware of other non-conformances in the gcc 4.x
C++ FE. I'm interested in collecting test cases which do demonstrate
other non-conformances for this compiler.

-Howard
 
A

Axter

Robert said:
Your question requires a rather complex answer. Herb Sutter pulled
together a "roundup" about C++ compiler conformance several years ago.
The reference is below. I'm not sure if any compiler has made great
strides since the roundup. So it is still worthwhile reading. Please
note that the Comeau compiler is mentioned in some detail.

http://www.cuj.com/documents/s=8193/cuj0104sutter/

I have used Comeau for a number of years. I have found Greg to be
honest and helpful in his correspondence. The compiler is pretty good
with compliance. I think that it handles templates well. Much of the
noncompliance problems, that I have encountered, involve the legacy
library that I use to back-end his compiler. Comeau has no control
over the legacy library, of course. But on balance, it has not been
that much of a problem. I would recommend the product.

The above link is very out dated with respects to the VC++ compiler.
VC++ 6.0 compiler is a pre-standard compiler, and so it has poor
compliance.
And considering VC++ 7.0 is a post-standard compiler, (IMHO) it also
has poor compliance.
However, VC++ 7.1 has very good C++ compliance ratings, and it's ranked
as one of the highest.
 
R

Roland Csaszar

Hi,

At Sun, 01 Jan 2006 11:13:25 +0000,
Dave said:
For Solaris and Linux, take a look at Sun Studio 11, which is now a free
download (a large one, at well over 200 MB).

Sun Studio is not a compiler, it's an IDE. Btw. Sun Studio on Linux uses
the gcc because Sun didn't port their compiler to Linux, so on Linux there
is obviously no differnce in standard compliance to gcc ;).


Regards,
Roland
 
V

Victor Bazarov

Axter said:
The above link is very out dated with respects to the VC++ compiler.

No, it isn't. The link is to the article published in the early 2001.
At the time there was no _published_ version 7.0 or 7.1 of VC++. So,
it does refer to VC++ v6.0. See the revewees' comments section as well.
Did you actually bother to read the article?
VC++ 6.0 compiler is a pre-standard compiler, and so it has poor
compliance.
And considering VC++ 7.0 is a post-standard compiler, (IMHO) it also
has poor compliance.
However, VC++ 7.1 has very good C++ compliance ratings, and it's
ranked as one of the highest.

It has nothing to do with the round-up. Incidentally, Herb Sutter is now
working for Microsoft which should lead to improvements in their compiler
among other things.

V
 
J

James Dennett

Dave said:
I know gcc is not compliant.

Is studio 11 not compliant?

I would expect not; Studio 10 was the furthest from standards compliance
of the compilers I regularly use. Sun tends to try *very* hard to
preserve backwards compatibility, often at the expense of strict
standards compliance.
You surprise me there.

My own experience for what it worth, is there is nothing like testing
software on various architectures to find bugs and portability issues.

One of my programs has been tested on just about everything from a Sony
Playstation 2 games console to a Cray Supercomputer. In between them,
there has been PCs running just about every OS you can think of
(including Windoze), Suns running Solaris, SGI Octane running IRIX, Dec
Alpa running Tru64, HP C3000 running HP-UX, IBM/6000 running AIX and so
on. If you can test your code on all those machines and find it compiles
OK, you can be pretty sure it is portable. Where possible I have avoided
the use of gcc, but of course that is not always possible.

The Cray was the biggest headache, with sizeof(short)=8. Having short,
int and long all 8 bytes is a bit tricky if you write binary files.

If you write binary files, you should normally convert everything
to (arrays of) possibly-unsigned char first, and sizeof(short)
does not matter. If you write builtins or structs as raw data
without doing so, you do indeed run into other problems.
I don't claim my code (which I would add is C not C++) is compliant with
the ANSI (or any other) C standard, but it does compile and build on any
machine I can find, with any modern(ish) compiler I can find.

Which indicates that you probably stick to a portable subset
of C, and most C compilers can cope with the original ANSI/ISO
C standard though not the current one from 1999. C++ compliance
is another matter, and Comeau's C++ compiler is the only
commercially available one that can cope with the whole C++
language, including "export" (bugs excepted).

-- James
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top