Standards

Discussion in 'C Programming' started by Ian Tuomi, Oct 17, 2003.

  1. Ian Tuomi

    Ian Tuomi Guest

    Hello. I have been reading about all the different standards in C and I
    am quite confused, and have a few questions. ()

    How is C99 "better" than older versions of C? (or is it?)
    What is the "official" C definition nowadays? C99?
    What standard does K&R 2nd edition describe?
    Where can I get a book that has the latest(or best) standard?
    What is the most used standard?

    What books should every C programmer have? (I allready have K&R 2)

    --
    Ian Tuomi
    Jyväskylä, Finland

    "Very funny scotty, now beam down my clothes."

    NOTE: Remove NOSPAM from address
    Ian Tuomi, Oct 17, 2003
    #1
    1. Advertising

  2. Ian Tuomi

    Noah Roberts Guest

    Ian Tuomi wrote:
    > Hello. I have been reading about all the different standards in C and I
    > am quite confused, and have a few questions. ()
    >
    > How is C99 "better" than older versions of C? (or is it?)
    > What is the "official" C definition nowadays? C99?


    I think so, but I loose track :p

    > What standard does K&R 2nd edition describe?


    ansi

    > Where can I get a book that has the latest(or best) standard?
    > What is the most used standard?
    >
    > What books should every C programmer have? (I allready have K&R 2)
    >

    That should do you good for the language itself, no other book I have
    seen compares adiquately.

    Besides that you will want something specific to certain areas of
    programming, for instance you might want a Unix programmer book or
    something on game programming....depending on your area of interest.
    Standard C will not get you very far, you need to break away from
    "stardand C" and learn other standards, like POSIX or OpenGL, to become
    effective. Since this is such a wide topic I can't recommend anything,
    you will want to go to a programmer group in your area of interest and
    ask about good books there.

    --
    Noah Roberts
    - "If you are not outraged, you are not paying attention."
    Noah Roberts, Oct 17, 2003
    #2
    1. Advertising

  3. Ian Tuomi wrote:
    > What is the "official" C definition nowadays? C99?


    Yes, C99, otherwise known as ISO/IEC 9899:1999. There have also been
    a couple of (very minor) updates since C99 came out.

    > What standard does K&R 2nd edition describe?


    K&R was written shortly before C89 was released. With some small
    exceptions, it describes C89.

    > Where can I get a book that has the latest(or best) standard?


    C99 is available in electronic form from http://webstore.ansi.org and
    in book form, ISBN 0470845732 (e.g. from <URL:
    http://www.compman.co.uk/cgi-win/browse.exe?ref=530551> ).

    > What is the most used standard?


    C89 is very widely implemented. There are very few conforming C99
    implementations at the moment, although an increasing number of
    vendors are adding at least some of the new features.

    Jeremy.
    Jeremy Yallop, Oct 17, 2003
    #3
  4. Re: Standards (long)

    Ian Tuomi <> wrote:

    >Hello. I have been reading about all the different standards in C and I
    >am quite confused, and have a few questions. ()
    >
    >How is C99 "better" than older versions of C? (or is it?)


    That's a list of changes, taken from the current standard itself:

    [...] Major changes from the previous edition include:

    — restricted character set support via digraphs and <iso646.h>
    (originally specified in AMD1)
    — wide character library support in <wchar.h> and <wctype.h> (originally
    specified in AMD1)
    — more precise aliasing rules via effective type
    — restricted pointers
    — variable-length arrays
    — flexible array members
    — static and type qualifiers in parameter array declarators
    — complex (and imaginary) support in <complex.h>
    — type-generic math macros in <tgmath.h>
    — the long long int type and library functions
    — increased minimum translation limits
    — additional floating-point characteristics in <float.h>
    — remove implicit int
    — reliable integer division
    — universal character names (\u and \U)
    — extended identifiers
    — hexadecimal floating-point constants and %a and %A printf/scanf
    conversion specifiers
    — compound literals
    — designated initializers
    — // comments
    — extended integer types and library functions in <inttypes.h> and
    <stdint.h>
    — remove implicit function declaration
    — preprocessor arithmetic done in intmax_t/uintmax_t
    — mixed declarations and code
    — new block scopes for selection and iteration statements
    — integer constant type rules
    — integer promotion rules
    — macros with a variable number of arguments
    — the vscanf family of functions in <stdio.h> and <wchar.h>
    — additional math library functions in <math.h>
    — floating-point environment access in <fenv.h>
    — IEC 60559 (also known as IEC 559 or IEEE arithmetic) support
    — trailing comma allowed in enum declaration
    — %lf conversion specifier allowed in printf
    — inline functions
    — the snprintf family of functions in <stdio.h>
    — boolean type in <stdbool.h>
    — idempotent type qualifiers
    — empty macro arguments
    — new struct type compatibility rules (tag compatibility)
    — additional predefined macro names
    — _Pragma preprocessing operator
    — standard pragmas
    — _ _func_ _ predefined identifier
    — VA_COPY macro
    — additional strftime conversion specifiers
    — LIA compatibility annex
    — deprecate ungetc at the beginning of a binary file
    — remove deprecation of aliased array parameters
    — conversion of array to pointer not limited to lvalues
    — relaxed constraints on aggregate and union initialization
    — relaxed restrictions on portable header names
    — return without expression not permitted in function that returns a
    value (and vice versa)


    >What is the "official" C definition nowadays? C99?


    ISO/IEC 9899:1999, short C99


    >What standard does K&R 2nd edition describe?


    It is based on a draft version of ANSI C89.


    >Where can I get a book that has the latest(or best) standard?


    The standard itself, of course:

    The C Standard
    by British Standards Institute
    Published by John Wiley & Sons Ltd
    750+ pages
    ISBN 0-470-84573-2

    I paid 55,- EUR at my local book store. It's worth it.

    Also available as PDF document, you should be able to find the order
    form via http://www.dkuug.dk/JTC1/SC22/WG14/.


    >What is the most used standard?


    Currently C89/C90, as of now there are only few (no?) fully conforming
    implementations of C99.

    >What books should every C programmer have? (I allready have K&R 2)


    K&R2 will do fine, especially when accompanied by the standard itself.
    You can find more recommendations in Section 20 of the c.l.c-faq,
    residing at http://www.eskimo.com/~scs/C-faq/top.html .

    HTH

    Regards
    --
    Irrwahn
    ()
    Irrwahn Grausewitz, Oct 17, 2003
    #4
  5. In article <bmp00l$l10$>,
    Ian Tuomi <> wrote:
    >Hello. I have been reading about all the different standards in C and I
    >am quite confused, and have a few questions. ()
    >
    >How is C99 "better" than older versions of C? (or is it?)


    It adds some features to the language that may be useful. Whether they
    are in fact useful for what you want to do, combined with considerations
    like availability of implementations (which will improve as time goes on),
    determines whether it is in fact "better".


    >What is the "official" C definition nowadays? C99?


    C99 (properly known as "ANSI/ISO/IEC 9899:1999", if I've gotten the order
    of the organization-name TLAs in the name correct) is the most recent
    formal definition and probably has the best claim to being "official".
    C90 (9899:1990) is probably more useful to you as a programmer, since
    it's the one that most of the implementations you'll use and most of
    the code you'll work with were written for.


    >What standard does K&R 2nd edition describe?


    C90, with a few "errors" in things that were changed between the late
    drafts of the standard (which the first printing of the book was based
    on) and the final version and that were missed in the update to the book.
    (If you manage to find a first printing of K&R2, it in fact describes
    late-draft C89. I would assume that these are fairly rare, especially
    if you're buying your copy new.)


    >Where can I get a book that has the latest(or best) standard?


    You can get C99 in electronic format from a few different standards
    organizations as well as in book form, as other posters have noted.


    >What is the most used standard?


    C90, often (but not anywhere near universally) used with extra extensions
    to handle things like networking and graphics that the C standard
    doesn't define.


    >What books should every C programmer have? (I allready have K&R 2)


    K&R2 and a copy of the standard (either electronic or hard-copy) are
    about the only C-specific books you'll need.

    Besides language references, every programmer's library should include:
    -General books on programming - Knuth is the canonical "If you're *really*
    serious about it, you should get this one" book, but you'll probably
    also want to get something a little bit more cookbook-ish for when
    you don't have the time or energy to work through the theory behind
    something. There are a lot of good books that discuss algorithms,
    data structures, and program design; one or two of these will be
    Very Helpful.
    -References on any APIs you'll be using. A good Unix book if you're
    writing Unix programs, a good Windows book if you're writing Windows
    programs, a good network programming book if you're writing programs
    that talk to a network, a good OpenGL book if you're using OpenGL... you
    get the idea.

    If you're working in a cold office, something like C for Dummies or
    anything by Schildt might also be useful - if you get too cold, you can
    always burn a few pages from them to keep warm.


    dave

    --
    Dave Vandervies
    Perhaps you should reflect on the fact that books are seldom sold by the
    kilogram.
    --Kevin Easton in comp.lang.c
    Dave Vandervies, Oct 17, 2003
    #5
  6. On Fri, 17 Oct 2003, Ian Tuomi wrote:

    > Hello. I have been reading about all the different standards in C and I
    > am quite confused, and have a few questions. ()
    >
    > How is C99 "better" than older versions of C? (or is it?)


    A new standard is usually a response to people being dissatisfied with the
    old standard. To some people the C99 standard might not be considered
    "better" or to people who did not like features of the old standard they
    might appreciate the changes in C99.

    > What is the "official" C definition nowadays? C99?


    Not sure what you mean by "official". A lot of compilers are still using
    the old standard. So does "official" mean the most widely available? Or
    does it mean the last update to the standard?

    > What standard does K&R 2nd edition describe?


    K&R 2nd edition was created before 1999 so it would be for the older
    standard.

    > Where can I get a book that has the latest(or best) standard?


    The standard can be purchased online from ISO at http://www.iso.ch/. Enter
    the web site and look for a link to the ISO Store.

    > What is the most used standard?


    I believe the most used C standard is the ISO/IEC 9899:1990 (or ANSI
    9899:1989) since compilers which support 9899:1999 are harder to find.

    > What books should every C programmer have? (I allready have K&R 2)


    A copy of the standard would be the next step.

    > --
    > Ian Tuomi
    > Jyväskylä, Finland
    >
    > "Very funny scotty, now beam down my clothes."
    >
    > NOTE: Remove NOSPAM from address
    >
    >


    --
    Send e-mail to: darrell at cs dot toronto dot edu
    Don't send e-mail to
    Darrell Grainger, Oct 18, 2003
    #6
  7. Irrwahn Grausewitz <> wrote:

    Ian Tuomi <> wrote:
    <snip>
    >>What standard does K&R 2nd edition describe?

    >
    >It is based on a draft version of ANSI C89.


    I wonder nobody has objected to this.

    K&R1 is based on a late draft of C89.
    K&R2 is based on final C89.
    --
    Irrwahn
    ()
    Irrwahn Grausewitz, Oct 18, 2003
    #7
  8. Irrwahn Grausewitz wrote:
    > Irrwahn Grausewitz <> wrote:
    >
    > Ian Tuomi <> wrote:
    ><snip>
    >>>What standard does K&R 2nd edition describe?

    >>
    >>It is based on a draft version of ANSI C89.

    >
    > I wonder nobody has objected to this.


    Nobody objected because it's correct.

    > K&R1 is based on a late draft of C89.
    > K&R2 is based on final C89.


    Nope. K&R1 was published in 1978. The ANSI standardisation process
    for C began in 1983. K&R2 was published in 1988 and the first ANSI C
    standard was published at the end of the following year.

    Jeremy.
    Jeremy Yallop, Oct 18, 2003
    #8
  9. Jeremy Yallop <> wrote:

    >Irrwahn Grausewitz wrote:
    >> Irrwahn Grausewitz <> wrote:
    >>
    >> Ian Tuomi <> wrote:
    >><snip>
    >>>>What standard does K&R 2nd edition describe?
    >>>
    >>>It is based on a draft version of ANSI C89.

    >>
    >> I wonder nobody has objected to this.

    >
    >Nobody objected because it's correct.
    >
    >> K&R1 is based on a late draft of C89.
    >> K&R2 is based on final C89.

    >
    >Nope. K&R1 was published in 1978. The ANSI standardisation process
    >for C began in 1983. K&R2 was published in 1988 and the first ANSI C
    >standard was published at the end of the following year.


    Oh boy, now I've miscorrected my own post. <sigh>
    Thanks for re-correction.
    --
    Irrwahn,
    insert coin to engage my brain.
    --
    Irrwahn
    ()
    Irrwahn Grausewitz, Oct 18, 2003
    #9
  10. Ian Tuomi

    Dan Pop Guest

    In <bmp406$pl413$-berlin.de> Jeremy Yallop <> writes:

    >Ian Tuomi wrote:
    >> What is the "official" C definition nowadays? C99?

    >
    >Yes, C99, otherwise known as ISO/IEC 9899:1999. There have also been
    >a couple of (very minor) updates since C99 came out.

    ^^^^^^^^^^^
    I'm only aware of TC1. What am I missing?

    Dan
    --
    Dan Pop
    DESY Zeuthen, RZ group
    Email:
    Dan Pop, Oct 20, 2003
    #10
  11. Ian Tuomi

    Dan Pop Guest

    In <bmr7jh$pugo5$-berlin.de> Jeremy Yallop <> writes:

    >Nope. K&R1 was published in 1978. The ANSI standardisation process
    >for C began in 1983. K&R2 was published in 1988 and the first ANSI C
    >standard was published at the end of the following year.


    However, the 2nd and later printings of K&R2 postdate the C89 standard and
    were updated to actually describe it, rather than the draft the first
    printing was based on. To know which flavour of the book you have, simply
    look at its cover: it clearly states whether the book is covering the
    draft or the actual standard.

    Note that the update was not 100% accurate, there are a few minor
    differences between the draft and C89 that haven't yet been fixed in
    the book.

    Dan
    --
    Dan Pop
    DESY Zeuthen, RZ group
    Email:
    Dan Pop, Oct 20, 2003
    #11
  12. Dan Pop wrote:
    > In <bmp406$pl413$-berlin.de> Jeremy Yallop <> writes:
    >
    >>Ian Tuomi wrote:
    >>> What is the "official" C definition nowadays? C99?

    >>
    >>Yes, C99, otherwise known as ISO/IEC 9899:1999. There have also been
    >>a couple of (very minor) updates since C99 came out.

    > ^^^^^^^^^^^
    > I'm only aware of TC1. What am I missing?


    Hmm. Reading that again I'm not sure what I was thinking of. Perhaps
    TC2 to C90. Sorry about that.

    Jeremy.
    Jeremy Yallop, Oct 20, 2003
    #12
  13. Dan Pop wrote:
    > In <bmr7jh$pugo5$-berlin.de> Jeremy Yallop <> writes:
    >
    >>Nope. K&R1 was published in 1978. The ANSI standardisation process
    >>for C began in 1983. K&R2 was published in 1988 and the first ANSI C
    >>standard was published at the end of the following year.

    >
    > However, the 2nd and later printings of K&R2 postdate the C89 standard and
    > were updated to actually describe it, rather than the draft the first
    > printing was based on. To know which flavour of the book you have, simply
    > look at its cover: it clearly states whether the book is covering the
    > draft or the actual standard.


    Thanks for the clarification.

    > Note that the update was not 100% accurate, there are a few minor
    > differences between the draft and C89 that haven't yet been fixed in
    > the book.


    Are these things that aren't in the errata either? If so, what are
    they?

    Jeremy.
    Jeremy Yallop, Oct 20, 2003
    #13
  14. (Dan Pop) writes:
    > In <bmr7jh$pugo5$-berlin.de> Jeremy Yallop
    > <> writes:
    >
    > >Nope. K&R1 was published in 1978. The ANSI standardisation process
    > >for C began in 1983. K&R2 was published in 1988 and the first ANSI C
    > >standard was published at the end of the following year.

    >
    > However, the 2nd and later printings of K&R2 postdate the C89 standard and
    > were updated to actually describe it, rather than the draft the first
    > printing was based on. To know which flavour of the book you have, simply
    > look at its cover: it clearly states whether the book is covering the
    > draft or the actual standard.
    >
    > Note that the update was not 100% accurate, there are a few minor
    > differences between the draft and C89 that haven't yet been fixed in
    > the book.


    There's also an errata list at
    <http://cm.bell-labs.com/cm/cs/cbook/2ediffs.html>. I don't know
    whether the published book plus the errata is 100% consistent with the
    C89 (or C90) standard.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://www.sdsc.edu/~kst>
    Schroedinger does Shakespeare: "To be *and* not to be"
    Keith Thompson, Oct 20, 2003
    #14
  15. Ian Tuomi

    Dan Pop Guest

    In <bn1kma$s5l1v$-berlin.de> Jeremy Yallop <> writes:

    >Dan Pop wrote:
    >
    >> Note that the update was not 100% accurate, there are a few minor
    >> differences between the draft and C89 that haven't yet been fixed in
    >> the book.

    >
    >Are these things that aren't in the errata either? If so, what are
    >they?


    I suspect that, 14 years after the release of C89, all the bugs have been
    reported to the authors and included in the errata. Unfortunately, they
    have not been corrected in the more recent printings of the book.

    Dan
    --
    Dan Pop
    DESY Zeuthen, RZ group
    Email:
    Dan Pop, Oct 21, 2003
    #15
    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. Jim Culver

    coding standards

    Jim Culver, Sep 9, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    2,194
  2. shbgupta

    coding standards

    shbgupta, Jun 27, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    534
    Chance Hopkins
    Jun 27, 2003
  3. Paul G
    Replies:
    1
    Views:
    380
    John Timney \(Microsoft MVP\)
    Feb 26, 2004
  4. =?Utf-8?B?bWtsYXBw?=

    Evolving Web App Standards and ASP.NET

    =?Utf-8?B?bWtsYXBw?=, Jul 19, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    398
    Mr. Dot Net
    Jul 20, 2004
  5. SMG
    Replies:
    0
    Views:
    298
Loading...

Share This Page