Questions about C90 vs C99

Discussion in 'C Programming' started by dspfun, Dec 10, 2007.

  1. dspfun

    dspfun Guest

    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!
     
    dspfun, Dec 10, 2007
    #1
    1. Advertising

  2. dspfun

    Default User Guest

    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
     
    Default User, Dec 10, 2007
    #2
    1. Advertising

  3. dspfun

    K. Jennings Guest

    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?
     
    K. Jennings, Dec 10, 2007
    #3
  4. "K. Jennings" <> wrote in
    news:p:


    > 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
     
    Tomás Ó hÉilidhe, Dec 10, 2007
    #4
  5. dspfun

    Default User Guest

    Tomas S hIilidhe wrote:

    > "K. Jennings" <> wrote in
    > news:p:
    >
    >
    > > 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
     
    Default User, Dec 10, 2007
    #5
  6. dspfun

    Guest

    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.
     
    , Dec 10, 2007
    #6
  7. 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.
     
    Mark McIntyre, Dec 10, 2007
    #7
  8. dspfun

    Tor Rustad Guest

    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/testing/checklist/u03brand.html

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

    --
    Tor < | tr i-za-h a-z>
     
    Tor Rustad, Dec 11, 2007
    #8
  9. dspfun

    dspfun Guest

    > On 11 Dec, 00:10, 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?
     
    dspfun, Dec 11, 2007
    #9
  10. "Tomás Ó hÉilidhe" <> writes:
    > "K. Jennings" <> wrote in
    > news:p:
    >
    >
    >> 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) <>
    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"
     
    Keith Thompson, Dec 11, 2007
    #10
  11. In article <>,
    Keith Thompson <> wrote:
    >And of course C99 adds a few new keywords, which are no longer
    >available for use as ordinary identifiers (inline, restrict).


    One of which (inline) I actually ran into the other day. The error
    message wasn't very enlightening.

    -- Richard
    --
    :wq
     
    Richard Tobin, Dec 11, 2007
    #11
  12. dspfun

    James Kuyper Guest

    dspfun wrote:
    >> On 11 Dec, 00:10, 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?


    For the standards themselves? I presume the answer is yes, though I
    don't know the details. ISO has standards that prescribe how ISO
    standards are supposed to be written, and I would expect that ISO is
    sufficiently bureaucratic that it actually enforces those standards. ISO
    has no external enforcement powers, but the standards that govern other
    ISO standards are a purely internal affair.
     
    James Kuyper, Dec 11, 2007
    #12
  13. dspfun

    dspfun Guest

    On 11 Dec, 12:19, James Kuyper <> wrote:
    > dspfun wrote:
    > >> On 11 Dec, 00:10, 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?

    >
    > For the standards themselves? I presume the answer is yes, though I
    > don't know the details. ISO has standards that prescribe how ISO
    > standards are supposed to be written, and I would expect that ISO is
    > sufficiently bureaucratic that it actually enforces those standards. ISO
    > has no external enforcement powers, but the standards that govern other
    > ISO standards are a purely internal affair.


    Ok, thanks! What I meant was if there is/was an official certification
    process for C89/C90 compilers.
     
    dspfun, Dec 11, 2007
    #13
  14. dspfun

    Guest

    dspfun wrote:
    > On 11 Dec, 12:19, James Kuyper <> wrote:
    > > dspfun wrote:
    > > >> On 11 Dec, 00:10, 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?

    ....
    > Ok, thanks! What I meant was if there is/was an official certification
    > process for C89/C90 compilers.


    ??? - I already answered that question, and you've quoted my answer
    above, just before repeating the question. That's why I assumed that
    you had to be asking a different question.
     
    , Dec 11, 2007
    #14
  15. dspfun

    dspfun Guest

    On 11 Dec, 18:45, wrote:
    > dspfun wrote:
    > > On 11 Dec, 12:19, James Kuyper <> wrote:
    > > > dspfun wrote:
    > > > >> On 11 Dec, 00:10, 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?

    > ...
    > > Ok, thanks! What I meant was if there is/was an official certification
    > > process for C89/C90 compilers.

    >
    > ??? - I already answered that question, and you've quoted my answer
    > above, just before repeating the question. That's why I assumed that
    > you had to be asking a different question.


    Ok, I wasn't sure if you meant your answer was valid for all (C89, C90
    and C99). Now I know, thanks!
     
    dspfun, Dec 11, 2007
    #15
  16. On 10 Dec, 21:45, dspfun <> wrote:

    > 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?


    portability

    > Dito for c99?


    shiney new features


    > 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.


    I encourage people to use C90. If some feature of C99 was *really*
    needed (rather than a convenience) (eg. complex numbers) then I'd
    recomend C99 (or maybe C++...)

    <snip>


    --
    Nick Keighley

    Q: How many surrealists does it take to change a light bulb?
    A: Two. One to hold the giraffe and the other to fill the bathtub
    with
    brightly colored machine tools.
     
    Nick Keighley, Dec 12, 2007
    #16
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bernard

    Is these functions C90 and/or C99 ?

    Bernard, Jun 23, 2004, in forum: C Programming
    Replies:
    3
    Views:
    1,240
    E. Robert Tisdale
    Jun 24, 2004
  2. Jason Curl

    Char difference between C90 and C99

    Jason Curl, Jun 21, 2005, in forum: C Programming
    Replies:
    11
    Views:
    805
  3. Replies:
    3
    Views:
    3,730
    Chris Torek
    Feb 20, 2006
  4. Pedro Graca

    size_t and C90/C99

    Pedro Graca, Feb 11, 2006, in forum: C Programming
    Replies:
    7
    Views:
    1,724
    Keith Thompson
    Feb 12, 2006
  5. Spiro Trikaliotis

    List of differences in headers between C90 and C99?

    Spiro Trikaliotis, Mar 29, 2007, in forum: C Programming
    Replies:
    6
    Views:
    631
    Spiro Trikaliotis
    Mar 30, 2007
Loading...

Share This Page