Results 1 to 5 of 5

Thread: ansi vs iso C

  1. #1
    Join Date
    Nov 2008
    Location
    Maine
    Beans
    1,126
    Distro
    Ubuntu 10.04 Lucid Lynx

    Question ansi vs iso C

    Hi Everyone,
    I'm reading a book on C programing which specifies itself as ANSI.
    So I have a few questions about ANSI vs ISO.
    Like does it matter at all? What is the modern standard? Which has more relivance in the linux community. And what does gcc use?
    ~Conradin~

  2. #2
    Join Date
    Jun 2007
    Location
    Paraparaumu, New Zealand
    Beans
    Hidden!

    Re: ansi vs iso C

    Thread moved to Programming Talk.

    My experience with C is limited. No doubt there will be others who are more qualified than myself who will be forthcoming with their eloquence.
    Forum DOs and DON'Ts
    Please use CODE tags
    Including your email address in a post is not recommended
    My Blog

  3. #3
    Join Date
    Apr 2007
    Location
    NorCal
    Beans
    1,149
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: ansi vs iso C

    ANSI and ISO are just different organizations that ratify standards. The standards that one of them produces is usually named by the year it came out: C89 (aka C90) is the standard released in 1989, and the other major standard C99 was released in 1999. In general, you can assume most compilers/systems will implement C89 - it's been around a long time and has pretty much universally been adopted. C99, despite being around for over 10 years, is still not supported everywhere. Major open source compilers (gcc, clang) implement C99 fully, Microsoft's C compiler, however, doesn't. So, if you want to write portable code, it's best to restrict yourself to C89. If you know your code will always be run on a platform that supports it, it's fine to use C99. Note also that some compilers have their own extensions to the language (gnu89, gnu99, etc from gcc. it defaults to gnu89).

    Generally, when one says "ANSI C", they mean C89/C90.

    Note: there's also a new C11 standard, but since it was only just published it doesn't have wide support.
    Last edited by schauerlich; March 9th, 2012 at 07:35 AM.
    Posting code? Use the [code] or [php] tags.
    I don't care, I'm still free. You can't take the sky from me.

  4. #4
    Join Date
    Nov 2008
    Location
    Maine
    Beans
    1,126
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: ansi vs iso C

    Thanks schauerlich, That helps a lot!
    ~Conradin~

  5. #5
    Join Date
    Feb 2009
    Beans
    1,469

    Re: ansi vs iso C

    ISO C90 and ANSI C89 are pretty much exactly the same thing; at least, I can't recall hearing of any substantial difference between them. C99 is not maintained by ANSI and is never referred to as "ANSI".

    Off topic, C11 adds a handful of new features and makes some of the mandatory C99 features optional (most notably VLAs). No major compilers have adopted C11 yet.
    Last edited by trent.josephsen; March 10th, 2012 at 04:04 PM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •