Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Questions about C90 vs C99

Reply
Thread Tools

Questions about C90 vs C99

 
 
dspfun
Guest
Posts: n/a
 
      12-10-2007
Hi!

I am trying to understand weather to use c89/c90 or c99 and have come
up with some questions that I would be interested in hearing your
thoughts about:

What is the advantage of writing a program according to c90? Dito for
c99?

What is the disadvantage of asking someone to write a program
according to c90 instead of c99? Dito for "c99 instead of c90"?

What do you recommend when giving programming assignmnts/jobs: "write
the program according to c90" or "write the program according c99"?

As far as I understand the best (best as being most portable) thing is
to write C-programs that comply with c89, c90 and c99.

How are C-compilers "officially certified" to comply with c89, c90 and
c99?

BRs!
 
Reply With Quote
 
 
 
 
Default User
Guest
Posts: n/a
 
      12-10-2007
dspfun wrote:


> What is the advantage of writing a program according to c90? Dito for
> c99?


I write C programs in the common subset of the two.




Brian
 
Reply With Quote
 
 
 
 
K. Jennings
Guest
Posts: n/a
 
      12-10-2007
On Mon, 10 Dec 2007 21:55:07 +0000, Default User wrote:

> dspfun wrote:
>
>
>> What is the advantage of writing a program according to c90? Dito for
>> c99?

>
> I write C programs in the common subset of the two.


Is C90 not a subset of C99?

 
Reply With Quote
 
Tomás Ó hÉilidhe
Guest
Posts: n/a
 
      12-10-2007
"K. Jennings" <(E-Mail Removed)> wrote in
news(E-Mail Removed):


> Is C90 not a subset of C99?



Not entirely, C99 got rid of implicit int and also implicit function
declarations for instance, and that's because they were anti-features in
the first place.

--
Tomás Ó hÉilidhe
 
Reply With Quote
 
Default User
Guest
Posts: n/a
 
      12-10-2007
Tomas S hIilidhe wrote:

> "K. Jennings" <(E-Mail Removed)> wrote in
> news(E-Mail Removed):
>
>
> > Is C90 not a subset of C99?

>
>
> Not entirely, C99 got rid of implicit int and also implicit function
> declarations for instance, and that's because they were anti-features
> in the first place.


Yep. Most of what you "lose" weren't good practices anyway.




Brian
 
Reply With Quote
 
jameskuyper@verizon.net
Guest
Posts: n/a
 
      12-10-2007
dspfun wrote:
> Hi!
>
> I am trying to understand weather to use c89/c90 or c99 and have come
> up with some questions that I would be interested in hearing your
> thoughts about:
>
> What is the advantage of writing a program according to c90? Dito for
> c99?


Writing for C90:
Compilable on virtually every implementation of C in existence.

Writing for C99:
You can take advantage of the new features of C99.

> What is the disadvantage of asking someone to write a program
> according to c90 instead of c99? Dito for "c99 instead of c90"?


Writing for C90:
You can't use the new features of C99.

Writing for C99:
Not all of the new features of C99 are fully implemented in widely
available implementations of C. However, most of them are.

> What do you recommend when giving programming assignmnts/jobs: "write
> the program according to c90" or "write the program according c99"?


I would favor C99. The features that are not yet widely implemented
can be avoided, and the ones that have been widely implemented will
probably be universally implemented in the not-to-distant future.

> As far as I understand the best (best as being most portable) thing is
> to write C-programs that comply with c89, c90 and c99.


That's the safest approach. I don't agree that it's "best" in all
circumstances. In some cases the advantage of being able to take
advantage of the new features of C99 is more important than the small
number of platforms where your code won't compile correctly.

> How are C-compilers "officially certified" to comply with c89, c90 and
> c99?


There's no official certification process. A number of private
companies provide test suites which can check for non-compliance.
Note: advertising copy to the contrary not-withstanding, it's not
possible to prove that a given implmentation is conforming; it's only
possible to prove that it's non-conforming. However, if you perform
enough tests for non-conformance on an implementation, and it passes
all of them, you can place some level of confidence in the idea that
it's conforming.

However, from the descriptions I've been given of these test suites,
it seems that many of them read between the lines of the standard and
interpret it as making stronger requirements than it actually makes.
What these tests really check for is whether the compiler conforms to
the standard with acceptable quality-of-implementation (QoI), which is
an important thing to know. My objection is only to the fact that
those test suites reportedly incorrectly label low-quality but fully
conforming implementations as being non-conforming.

I can't verify this from personal experience; those test suites are
not needed for my job, and are too expensive to justify buying for my
home computer.
 
Reply With Quote
 
Mark McIntyre
Guest
Posts: n/a
 
      12-10-2007
dspfun wrote:

> What is the advantage of writing a program according to c90? Dito for
> c99?


C90 is currently supported on a wider range of platforms.
C99 has some new features which you may find convenient.

> What is the disadvantage of asking someone to write a program
> according to c90 instead of c99? Dito for "c99 instead of c90"?


Hmm, sounds like a homework question...

> What do you recommend when giving programming assignmnts/jobs: "write
> the program according to c90" or "write the program according c99"?


"Write according to the capabilities of the compiler you have available
for the platforms you're targetting."
and
"Try to keep platform-specfific code separate from Standard C, but don't
get obsessive about it."

> How are C-compilers "officially certified" to comply with c89, c90 and
> c99?


Self-certification as far as I know.
 
Reply With Quote
 
Tor Rustad
Guest
Posts: n/a
 
      12-11-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> dspfun wrote:


[...]

>> How are C-compilers "officially certified" to comply with c89, c90 and
>> c99?

>
> There's no official certification process. A number of private
> companies provide test suites which can check for non-compliance.


Well, we do have the UNIX 03 certification, which comes with a validated
C99 compiler.

"ISO-C the requested output files from a valid release of either the
Perennial or Plum Hall test suites."
- http://www.opengroup.org/openbrand/t.../u03brand.html

IIRC, from the last time I checked, there was some 3-4 validated C99
compilers.

--
Tor <(E-Mail Removed) | tr i-za-h a-z>
 
Reply With Quote
 
dspfun
Guest
Posts: n/a
 
      12-11-2007
> On 11 Dec, 00:10, (E-Mail Removed) wrote:
> > dspfun wrote:


> > How are C-compilers "officially certified" to comply with c89, c90 and
> > c99?

>
> There's no official certification process.


Is there an official certification process for C89 or C90?
 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      12-11-2007
"Tomás Ó hÉilidhe" <(E-Mail Removed)> writes:
> "K. Jennings" <(E-Mail Removed)> wrote in
> news(E-Mail Removed):
>
>
>> Is C90 not a subset of C99?

>
>
> Not entirely, C99 got rid of implicit int and also implicit function
> declarations for instance, and that's because they were anti-features in
> the first place.


And of course C99 adds a few new keywords, which are no longer
available for use as ordinary identifiers (inline, restrict).

--
Keith Thompson (The_Other_Keith) <(E-Mail Removed)>
Looking for software development work in the San Diego area.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
List of differences in headers between C90 and C99? Spiro Trikaliotis C Programming 6 03-30-2007 02:24 PM
C99 struct initialization (C99/gcc) jilerner@yahoo.com C Programming 3 02-20-2006 04:41 AM
size_t and C90/C99 Pedro Graca C Programming 7 02-12-2006 10:07 AM
Char difference between C90 and C99 Jason Curl C Programming 11 06-24-2005 03:26 AM
Is these functions C90 and/or C99 ? Bernard C Programming 3 06-24-2004 12:45 AM



Advertisments