Difference between C89 and C99?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jason Curl

    #1

    Difference between C89 and C99?

    I've seen the document N869.txt and the copy I could find talks about
    C99. Is there anything that comprehensively describes the difference
    between C89 and C99? I'd like to write code to be as portable as possible.

    Thanks,
    Jason.
  • Chris Hills

    #2
    Re: Difference between C89 and C99?

    In article <d588j7$439$2@n ewshost.mot.com >, Jason Curl
    <j_dot_curl@mot orola.com> writes[color=blue]
    >I've seen the document N869.txt and the copy I could find talks about
    >C99. Is there anything that comprehensively describes the difference
    >between C89 and C99? I'd like to write code to be as portable as possible.
    >
    >Thanks,
    >Jason.[/color]

    K&R 1st ed was the original C description from the 1970's
    It is now obsolete as regards being the C language specification.

    K&R 2nd Ed pub 1988 their book update to C89
    C89 is an ANSI standard from dated 1989
    C90 is the ISO version and the first International C standard
    These three should be the same. K&R were on the ANSI panel that
    produced [ANSI] C89 and that became ISO-C90

    There have been various Amendments and TC's in 93,4,5 etc

    In 1999 there was a new version of the ISO-C standard. C99.
    The problem is that despite 2 TC's to C99 there are no conforming
    compilers for it. Most are part way between C90 and C99.

    If you want to write portable C I would use C99 with A1 and the TC's It
    is where (AFAIK) most of the compilers are at. Of course it depends what
    you are writing and what sort of portability you want. For portability
    there could be far more important issues than sticking to ISO-C

    BTW
    You should not be using any N*** document as these are committee working
    documents and therefore not accurate. They have been superseded by the
    published standard and will not include any/some/all changes (if any)
    after the reviews.

    Buy the standard if you want to work to it. Using an N*** document is
    like trying to write a legal document using a dictionary which may have
    an arbitrary number of spelling mistakes and incorrect definitions in
    it.



    /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
    \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/\
    /\/\/ chris@phaedsys. org www.phaedsys.org \/\/
    \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/



    Comment

    • lawrence.jones@ugs.com

      #3
      Re: Difference between C89 and C99?

      Jason Curl <j_dot_curl@mot orola.com> wrote:[color=blue]
      >
      > I've seen the document N869.txt and the copy I could find talks about
      > C99. Is there anything that comprehensively describes the difference
      > between C89 and C99? I'd like to write code to be as portable as possible.[/color]

      There's a brief listing of the new features in the Foreword of the C99
      standard. The list is reproduced on the committee's web site:

      <http://www.open-std.org/jtc1/sc22/wg14/www/newinc9x.htm>

      -Larry Jones

      All girls should be shipped to Pluto--that's what I say. -- Calvin

      Comment

      • CBFalconer

        #4
        Re: Difference between C89 and C99?

        Chris Hills wrote:[color=blue]
        >[/color]
        .... snip ...[color=blue]
        >
        > BTW
        > You should not be using any N*** document as these are committee
        > working documents and therefore not accurate. They have been
        > superseded by the published standard and will not include
        > any/some/all changes (if any) after the reviews.
        >
        > Buy the standard if you want to work to it. Using an N***
        > document is like trying to write a legal document using a
        > dictionary which may have an arbitrary number of spelling
        > mistakes and incorrect definitions in it.[/color]

        However N869 is quite adequate for most purposes, as long as you
        are willing to recognize the failings. It has the great advantage
        of having a text version, which the actual standard still fails to
        supply. A text version can be searched and manipulated with
        ordinary tools. Why ISO/ANSI refused to publish an official text
        version is beyond comprehension.

        --
        "If you want to post a followup via groups.google.c om, don't use
        the broken "Reply" link at the bottom of the article. Click on
        "show options" at the top of the article, then click on the
        "Reply" at the bottom of the article headers." - Keith Thompson

        Comment

        • Chris Croughton

          #5
          Re: Difference between C89 and C99?

          On Tue, 03 May 2005 20:20:05 GMT, CBFalconer
          <cbfalconer@yah oo.com> wrote:
          [color=blue]
          > However N869 is quite adequate for most purposes, as long as you
          > are willing to recognize the failings. It has the great advantage
          > of having a text version, which the actual standard still fails to
          > supply. A text version can be searched and manipulated with
          > ordinary tools. Why ISO/ANSI refused to publish an official text
          > version is beyond comprehension.[/color]

          Because they want to sell the PDF one to you as many times as possible?
          With their licence I can't even have a copy on my desktop and one on my
          laptop without paying twice. One of the standards (I don't remember if
          it's the C or the C++ one) won't even allow copy to clipboard, it's in
          some protected format.

          It's the same with the BSI standards, they want to charge lots of money
          for them, text would be too easy to distribute...

          (Has anyone produced a list of the differences between N869 and the
          standard? I wonder if there actually are any significant ones, or
          whether the "it's not accurate" is in fact FUD aimed at trying to sell
          the standard...)

          Personally I want my code to be portable, so I'm not knowingly using any
          extensions later than C89, there are too many compilers and libraries
          which aren't fully implementing C99 (and worse they each fail to
          implement different bits). Yes, it would be lovely if everything was up
          to date, but in the real world it isn't...

          Chris C

          Comment

          • Eric Sosman

            #6
            [OT] Re: Difference between C89 and C99?



            Chris Croughton wrote:[color=blue]
            > On Tue, 03 May 2005 20:20:05 GMT, CBFalconer
            > <cbfalconer@yah oo.com> wrote:
            >
            >[color=green]
            >>However N869 is quite adequate for most purposes, as long as you
            >>are willing to recognize the failings. It has the great advantage
            >>of having a text version, which the actual standard still fails to
            >>supply. A text version can be searched and manipulated with
            >>ordinary tools. Why ISO/ANSI refused to publish an official text
            >>version is beyond comprehension.[/color]
            >
            >
            > Because they want to sell the PDF one to you as many times as possible?
            > With their licence I can't even have a copy on my desktop and one on my
            > laptop without paying twice. One of the standards (I don't remember if
            > it's the C or the C++ one) won't even allow copy to clipboard, it's in
            > some protected format.[/color]

            If ANSI sold you a text version *under the exact same
            license conditions,* would that make a difference in your
            behavior? (If you're a United States citizen you need not
            answer; there's this nice little loophole called the Fifth
            Amendment to the Constitution, which says you cannot be
            required to incriminate yourself ;-)

            This strand of the thread seems to be straying from
            topicality on comp.lang.c; comp.std.c might be a better
            forum.

            --
            Eric.Sosman@sun .com

            Comment

            • Default User

              #7
              Re: Difference between C89 and C99?


              CBFalconer wrote:
              [color=blue]
              > However N869 is quite adequate for most purposes, as long as you
              > are willing to recognize the failings. It has the great advantage
              > of having a text version, which the actual standard still fails to
              > supply. A text version can be searched and manipulated with
              > ordinary tools. Why ISO/ANSI refused to publish an official text
              > version is beyond comprehension.[/color]


              This has been discussed many times in the past few years. Dan Pop was
              of the opinion that N869 was just fine. There are non-trivial
              differences, but if you make a mistake here based on one of those
              differences someone will gleefully point it out. Then you can annotate
              your copy so you don't make that mistake again. Of course, Dan was of
              the opinion that he knew more C without an offical copy of the Standard
              than some did *with* one.

              Mostly we use the Standards for argumentation. I am sure some of you
              are using the Standard daily for Very Important Work. You need not tell
              me that.



              Brian

              Comment

              • Jason Curl

                #8
                Re: Difference between C89 and C99?

                CBFalconer wrote:[color=blue]
                > Chris Hills wrote:
                >
                > .... snip ...
                >[color=green]
                >>BTW
                >>You should not be using any N*** document as these are committee
                >>working documents and therefore not accurate. They have been
                >>superseded by the published standard and will not include
                >>any/some/all changes (if any) after the reviews.
                >>
                >>Buy the standard if you want to work to it. Using an N***
                >>document is like trying to write a legal document using a
                >>dictionary which may have an arbitrary number of spelling
                >>mistakes and incorrect definitions in it.[/color]
                >
                >
                > However N869 is quite adequate for most purposes, as long as you
                > are willing to recognize the failings. It has the great advantage
                > of having a text version, which the actual standard still fails to
                > supply. A text version can be searched and manipulated with
                > ordinary tools. Why ISO/ANSI refused to publish an official text
                > version is beyond comprehension.
                >[/color]

                Probably the biggest interest is the different definitions of the
                library. I would write all syntax using C89/90 as this is guaranteed to
                work with C99 as well. The interesting bits would be what new
                libraries/functions are available in C99 that aren't in C89?

                Then using my development environment I can write functions for C99, and
                test using a configuration script that can test if a particular set up
                has a C99 implementation for a function or not.

                Thanks for all comments.

                Comment

                • Jason Curl

                  #9
                  Re: Difference between C89 and C99?

                  Chris Hills wrote:[color=blue]
                  > In article <d588j7$439$2@n ewshost.mot.com >, Jason Curl
                  > <j_dot_curl@mot orola.com> writes
                  >[color=green]
                  >>I've seen the document N869.txt and the copy I could find talks about
                  >>C99. Is there anything that comprehensively describes the difference
                  >>between C89 and C99? I'd like to write code to be as portable as possible.
                  >>
                  >>Thanks,
                  >>Jason.[/color]
                  >
                  >
                  > K&R 1st ed was the original C description from the 1970's
                  > It is now obsolete as regards being the C language specification.
                  >
                  > K&R 2nd Ed pub 1988 their book update to C89
                  > C89 is an ANSI standard from dated 1989
                  > C90 is the ISO version and the first International C standard
                  > These three should be the same. K&R were on the ANSI panel that
                  > produced [ANSI] C89 and that became ISO-C90
                  >
                  > There have been various Amendments and TC's in 93,4,5 etc
                  >
                  > In 1999 there was a new version of the ISO-C standard. C99.
                  > The problem is that despite 2 TC's to C99 there are no conforming
                  > compilers for it. Most are part way between C90 and C99.
                  >
                  > If you want to write portable C I would use C99 with A1 and the TC's It
                  > is where (AFAIK) most of the compilers are at. Of course it depends what
                  > you are writing and what sort of portability you want. For portability
                  > there could be far more important issues than sticking to ISO-C
                  >
                  > BTW
                  > You should not be using any N*** document as these are committee working
                  > documents and therefore not accurate. They have been superseded by the
                  > published standard and will not include any/some/all changes (if any)
                  > after the reviews.
                  >
                  > Buy the standard if you want to work to it. Using an N*** document is
                  > like trying to write a legal document using a dictionary which may have
                  > an arbitrary number of spelling mistakes and incorrect definitions in
                  > it.[/color]

                  Does the C99 standard differentiate between what's also in C89 and
                  what's new?
                  [color=blue]
                  >
                  >
                  >
                  > /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                  > \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/\
                  > /\/\/ chris@phaedsys. org www.phaedsys.org \/\/
                  > \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
                  >
                  >
                  >[/color]

                  Comment

                  • Chris Croughton

                    #10
                    Re: [OT] Re: Difference between C89 and C99?

                    On Tue, 03 May 2005 18:26:01 -0400, Eric Sosman
                    <eric.sosman@su n.com> wrote:
                    [color=blue]
                    > Chris Croughton wrote:[color=green]
                    >> On Tue, 03 May 2005 20:20:05 GMT, CBFalconer
                    >> <cbfalconer@yah oo.com> wrote:
                    >>[color=darkred]
                    >>>However N869 is quite adequate for most purposes, as long as you
                    >>>are willing to recognize the failings. It has the great advantage
                    >>>of having a text version, which the actual standard still fails to
                    >>>supply. A text version can be searched and manipulated with
                    >>>ordinary tools. Why ISO/ANSI refused to publish an official text
                    >>>version is beyond comprehension.[/color]
                    >>
                    >> Because they want to sell the PDF one to you as many times as possible?
                    >> With their licence I can't even have a copy on my desktop and one on my
                    >> laptop without paying twice. One of the standards (I don't remember if
                    >> it's the C or the C++ one) won't even allow copy to clipboard, it's in
                    >> some protected format.[/color]
                    >
                    > If ANSI sold you a text version *under the exact same
                    > license conditions,* would that make a difference in your
                    > behavior? (If you're a United States citizen you need not
                    > answer; there's this nice little loophole called the Fifth
                    > Amendment to the Constitution, which says you cannot be
                    > required to incriminate yourself ;-)[/color]

                    "I'll take the Fifth." "Make mine a double!" <g>

                    My own behaviour? Probably not. But having it in a proprietary format
                    which allows protection does make it more difficult for those people who
                    do want to copy chunks into other formats.
                    [color=blue]
                    > This strand of the thread seems to be straying from
                    > topicality on comp.lang.c; comp.std.c might be a better
                    > forum.[/color]

                    Although it's not about Standard C, it's about the attitude of standards
                    bodies in general. Which is probably not on topic anywhere in comp.*...

                    Chris C

                    Comment

                    • Michael Wojcik

                      #11
                      Re: Difference between C89 and C99?


                      In article <HZpjlsAT38dCFA KM@phaedsys.dem on.co.uk>, Chris Hills <chris@phaedsys .org> writes:[color=blue]
                      >
                      > The problem is that despite 2 TC's to C99 there are no conforming
                      > compilers for it. Most are part way between C90 and C99.[/color]

                      You keep making this claim, Chris, but I've yet to see any evidence
                      from you that the implementations which do claim C99 compliance are
                      not in fact conforming. I can think of at least three such implemen-
                      tations being cited here:

                      - Comeau C plus the Dinkumware libraries
                      - Edison Design Group C plus the Dinkumware libraries
                      - HP Compaq C for OpenVMS for Alpha

                      Some others that claim conformance:

                      - IBM C for AIX v6
                      - Intel C v8, except for FP_CONTRACT, FENV_ACCESS, and
                      CX_LIMITED_RANG E
                      - Lund Multiprocessor Complier Company LMPCC C99 v1.3

                      EDG+Dinkumware and LMPCC have received CVSA certificates.

                      So, if you have evidence that none of these is conforming, please let
                      us know; and if not, you might want to try to be a little more
                      accurate in your claims.

                      Really, is it that much harder to say "C99 conforming implementations
                      are rare"?

                      --
                      Michael Wojcik michael.wojcik@ microfocus.com

                      She felt increasingly (vision or nightmare?) that, though people are
                      important, the relations between them are not, and that in particular
                      too much fuss has been made over marriage; centuries of carnal
                      embracement, yet man is no nearer to understanding man. -- E M Forster

                      Comment

                      • CBFalconer

                        #12
                        Re: Difference between C89 and C99?

                        Jason Curl wrote:[color=blue]
                        > CBFalconer wrote:
                        >[/color]
                        .... snip ...[color=blue][color=green]
                        >>
                        >> However N869 is quite adequate for most purposes, as long as you
                        >> are willing to recognize the failings. It has the great advantage
                        >> of having a text version, which the actual standard still fails to
                        >> supply. A text version can be searched and manipulated with
                        >> ordinary tools. Why ISO/ANSI refused to publish an official text
                        >> version is beyond comprehension.[/color]
                        >
                        > Probably the biggest interest is the different definitions of the
                        > library. I would write all syntax using C89/90 as this is guaranteed
                        > to work with C99 as well. The interesting bits would be what new
                        > libraries/functions are available in C99 that aren't in C89?[/color]

                        The worst omission known to me is the absence of vsnprintf (or
                        something similar) in N869.

                        --
                        "If you want to post a followup via groups.google.c om, don't use
                        the broken "Reply" link at the bottom of the article. Click on
                        "show options" at the top of the article, then click on the
                        "Reply" at the bottom of the article headers." - Keith Thompson


                        Comment

                        • E. Robert Tisdale

                          #13
                          Re: Difference between C89 and C99?

                          Michael Wojcik wrote:
                          [color=blue]
                          > Chris Hills writes:
                          >[color=green]
                          >>The problem is that despite 2 TC's to C99 there are no conforming
                          >>compilers for it. Most are part way between C90 and C99.[/color]
                          >
                          > You keep making this claim, Chris,
                          > but I've yet to see any evidence from you
                          > that the implementations which do claim C99 compliance
                          > are not in fact conforming.
                          > I can think of at least three such implementations being cited here:
                          >
                          > - Comeau C plus the Dinkumware libraries
                          > - Edison Design Group C plus the Dinkumware libraries
                          > - HP Compaq C for OpenVMS for Alpha
                          >
                          > Some others that claim conformance:
                          >
                          > - IBM C for AIX v6
                          > - Intel C v8, except for FP_CONTRACT, FENV_ACCESS, and
                          > CX_LIMITED_RANG E
                          > - Lund Multiprocessor Complier Company LMPCC C99 v1.3
                          >
                          > EDG+Dinkumware and LMPCC have received CVSA certificates.
                          >
                          > So, if you have evidence that none of these is conforming,
                          > please let us know; and if not,
                          > you might want to try to be a little more accurate in your claims.
                          >
                          > Really, is it that much harder to say
                          > "C99 conforming implementations are rare"?[/color]

                          What does "rare" mean?
                          It appears that you can get a C99 conforming compiler
                          for just about every platform that C programmers target.
                          If you want to be *accurate*, you should say,
                          "C99 conforming implementations are ubiquitous."

                          I don't think that the resistance to the new standard
                          has anything to do with the availability of conforming compilers.
                          It's just an "olde fogyism".
                          Like everybody else, C programmers fear change as they get older.
                          They have resisted change and will continue to resist change
                          and younger programmers will just have to work around them
                          until they retire or die.

                          Comment

                          • Keith Thompson

                            #14
                            Re: Difference between C89 and C99?

                            "E. Robert Tisdale" <E.Robert.Tisda le@jpl.nasa.gov > writes:
                            [...][color=blue]
                            > What does "rare" mean?
                            > It appears that you can get a C99 conforming compiler
                            > for just about every platform that C programmers target.
                            > If you want to be *accurate*, you should say,
                            > "C99 conforming implementations are ubiquitous."[/color]

                            I hardly think that they're "ubiquitous ". I know of some platforms
                            that are not likely *ever* to have a conforming C99 compiler (though
                            they're not platforms that most of you are likely to use), and the
                            most widespread C implementation, gcc, is not fully conforming (for
                            example, variable-length arrays, complex and imaginary support, and
                            inline functions are still marked as "broken", even in gcc 4.0.0).

                            --
                            Keith Thompson (The_Other_Keit h) kst-u@mib.org <http://www.ghoti.net/~kst>
                            San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
                            We must do something. This is something. Therefore, we must do this.

                            Comment

                            • Mark McIntyre

                              #15
                              Re: [OT] Re: Difference between C89 and C99?

                              On Wed, 4 May 2005 14:38:51 +0100, in comp.lang.c , Chris Croughton
                              <chris@keristor .net> wrote:
                              [color=blue]
                              >On Tue, 03 May 2005 18:26:01 -0400, Eric Sosman
                              > <eric.sosman@su n.com> wrote:
                              >[color=green]
                              >> Chris Croughton wrote:[/color][/color]
                              [color=blue][color=green][color=darkred]
                              >>> One of the standards (I don't remember if
                              >>> it's the C or the C++ one) won't even allow copy to clipboard, it's in
                              >>> some protected format.[/color]
                              >>
                              >> If ANSI sold you a text version *under the exact same
                              >> license conditions,* would that make a difference in your
                              >> behavior?[/color]
                              >
                              >"I'll take the Fifth." "Make mine a double!" <g>[/color]

                              Remind me: does the international copyright convention still allow
                              'fair use' ? If so, ANSI's method of distribution would seem to be
                              illegal if it prevents copying of small chunks of text.


                              --
                              Mark McIntyre
                              CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
                              CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt >

                              ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
                              http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
                              ----= East and West-Coast Server Farms - Total Privacy via Encryption =----

                              Comment

                              Working...