D
Dan Pop
Well, they have done complex arithmetic. I am debugging my implementation of
complex arithmetic using gcc.
They already had complex arithmetic, because it was a GNU C feature long
before C99.
Dan
Well, they have done complex arithmetic. I am debugging my implementation of
complex arithmetic using gcc.
jacob navia said:The problem is that to do this conversion you cannot use the x86, since the
only 64 bit integer conversion in the x86 is signed. Unsigned long long means
that a quite long sequence of machine instructions must be emitted.
Randy Howard said:Surprised, anyone? This is not to start flame war, but IMHO people
using braindead M$VC for compiling C code are, err..., well..., nah,
I'm not going to insult someone for using a specific product.
Irrwahn
( using gcc, yet another product of the Sirius Cybernetics Corp. ;] )
Anyone read the latest DDJ, particularly the article on C and C++ compiler
performance? gcc gets it's proverbial butt handed to it in terms of
compile time, run-time performance and code size as compared to 8 or 9
other compilers, including that evil one from MS.
I'm not saying it's not a great product if you're really into writing code
for a ton of obscure platforms (as I seem to be doing more and more
lately), but ...
Really? Can't you just mask out the highest bit, use the signed conversion
to convert the lower 63 bits, then if the highest bit was set add a
floating point constant to the result?
Randy Howard said:Is it really the most used? I would probably suspect either
gcc (across a host of different platforms) or perhaps some
other 8051 specific compiler to the winner there.
Serve said:But when Richard Heathfield told me to "vote with my feet" I started
thinking that the same could be said for features that are implemented on
your implementation but not on others. Just don't use these other
implementations.
But then why is the emphasize in clc on portability?
In said:That's right. As long as at least one C99 implementation exists for the
target platform, portability of C99 code to that platform is not an issue,
even if some vendors are slow to support C99. So, if VC doesn't conform,
find a compiler that does, and use that instead.
Dan Pop said:Things are more complex than that, in real life. What if VC generates
much better object code, has much better diagnostics and debugging
facilities? Wouldn't it be sheer foolishness to ignore all these
advantages for the sake of being able to use the few bells and whistles
added by C99?
Dan said:
What if VC generates
much better object code, has much better diagnostics and debugging
facilities?
Wouldn't it be sheer foolishness to ignore all these
advantages for the sake of being able to use the few bells and whistles
added by C99?
Nope: certain C99 features cannot be implemented in portable C89 code.
Simon Josefsson said:[...]
Are there any C99 to C89 translators around? Is it possible to write
one?
Nope: certain C99 features cannot be implemented in portable C89 code.
Cannot easily be implemented, or not at all? Do you have an example
of something that would be impossible to translate into C89?
In said:Cannot easily be implemented, or not at all? Do you have an example
of something that would be impossible to translate into C89?
External identifiers wider than six characters. Internal identifiers
wider than 31 characters. The rest of the extended translation limits.
I'm not sure if flexible array members can be implemented in truly
portable C89 code.
A large chunk of the C99 library support cannot be implemented in portable
C89 code, as well as non-library related macros, like va_copy(). Without
a portable library implementation (i.e. one relying exclusively on the
standard C89 library features), there isn't much point in translating
portable C99 code to portable C89 code.
One important reason for using C99 is to take advantage of its advanced
optimisation features: restrict and inline. Both keywords would simply
get dropped by a C99 to C89 translator, because they have no C89
counterparts.
Kevin Easton said:I'm fairly sure you could write a C99 interpreter in standard C89, so a
simple proof would be to write a translator which just outputs the
interpeter source code, along with the C89 program text in an array.
That's quite well known already. GCC's design is based around
portability, and some design decisions to improve this (particularly the
split between front end and back end portions) rule out some kinds of
optimisations. There's also other optimisations that can't be included
because they're patented.
Which kinds of optimizations? Who are the primary patent holders? I am
certainly no expert of software patents. It seems unusual that patents
would be enforced against the freeware community. It's not like anyone
working on gcc is making any money out of it.
-Clint
Clint Olsen said:Which kinds of optimizations? Who are the primary patent holders? I am
certainly no expert of software patents. It seems unusual that patents
would be enforced against the freeware community. It's not like anyone
working on gcc is making any money out of it.
In said:I don't know the specific details (though when you're talking software
patents and compilers, the names "IBM", "Intel" and "DEC" are likely to
come up). However, there are people making money out of gcc - I believe
several makers of embedded systems supply toolchains for their products
built on gcc, and Apple's OS X uses a modified gcc.
Dan Pop said:Even if no one made any money from gcc, a gcc performing as well as the
commercial products based on the respective patents would significantly
reduce the sales of the commercial compilers (why pay big bucks for a
product that doesn't outperform a free one?).
Even if no one made any money from gcc, a gcc performing as well as the
commercial products based on the respective patents would significantly
reduce the sales of the commercial compilers (why pay big bucks for a
product that doesn't outperform a free one?).
Support. Lots of people spend lots of money for compilers that don't
outperform GCC just so they have someone to complain to and, if
necessary, sue when there are problems.
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.