Last time I checked, saying that you are coding in ANSI C was equal to say "this is C99 compliant code with nothing else in it". Now with C11 and C++11, does this distinction still remain? Does it still has some sort of meaning?

- 129,958
- 22
- 279
- 321

- 2,329
- 4
- 18
- 20
-
2C and C++ standards are ISO certified standards. – Alok Save Jan 03 '13 at 15:32
-
@AlokSave ok, but ANSI it's even another organization ... – user1849534 Jan 03 '13 at 15:33
-
Yes, they are different organizations but standardization process is integrated so essentially the ISO standard version is approved by ANSI too. – Alok Save Jan 03 '13 at 15:35
-
2"ANSI C" can have any number of different meanings. IMHO the only time when it had a universally recognized meaning was when it was used in contrast to K&R C. – NPE Jan 03 '13 at 15:36
-
@LihO please no wikipedia :( – user1849534 Jan 03 '13 at 15:36
-
1@AlokSaven since when ANSI automatically approves what ISO standardize ? – user1849534 Jan 03 '13 at 15:37
-
@NPE yep, that was my first source for this too, but in reality ANSI C is a real standard and not only a word from a book so I was thinking that maybe they are updating this somehow – user1849534 Jan 03 '13 at 15:38
-
@user1849534: IIRC ANSI and ISO did have separate publications of at least C89, but the differences were *supposed* to be confined to the title pages, layout and maybe index/endnote-type material. – Steve Jessop Jan 03 '13 at 15:40
-
1ANSI does not automatically approve anything.I am not sure how you concluded that.My previous comment says *"standardization process is integrated"*, ANSI participates in the the process. – Alok Save Jan 03 '13 at 15:42
-
Just avoid use of the phrase "ANSI C" in as much as possible; it will only ever confuse people. – Stephen Canon Jan 03 '13 at 16:17
-
The C language is standardized by the ISO now, and ever since 1990... – Antti Haapala -- Слава Україні Apr 18 '15 at 12:08
3 Answers
Historically "ANSI C" was used to mean "standard C", i.e. C89, by contrast with "K&R C" and the various pre-standard variants invented by compiler-writers. That's why the 2nd Ed. of "The C Programming Language" has a big red "ANSI C" stamp on the cover.
Then for a time "ISO C" was used to mean "the new standard C", i.e. C99, by contrast with "ANSI C".
This was always a confusing usage, since both ISO and ANSI ratified both C89 and C99. ISO ratified the former as C90, and published it with some layout changes from ANSI's version but supposedly the same substantial content. So "ANSI C" always was an ISO standard, and "ISO C" always was an ANSI standard. The only difference was which body oversaw the standardization process.
Following this usage (and probably encouraging it to continue), the -ansi
flag to GCC is equivalent to -std=c90
. It that context it actually means "C90, plus some GNU extensions that do not conflict with the standard".
I'm not aware of "ANSI C" referring to C99, but that doesn't mean it hasn't been used to mean that.
I don't think that using the term "ANSI C" has helped anyone in the last 10 years. ANSI ratified C11, but it would not be helpful to start saying, "aha! well in that case, ANSI C suddenly now means C11!". We can certainly say that C11 is the current ANSI C standard, but nevertheless the term "ANSI C" can't be used with any reasonable expectation that people will clearly understand it to mean C11.

- 273,490
- 39
- 460
- 699
-
1
-
thanks, so the best is not to use this words anymore if I have understood correctly, it's just something that can have different meaning and can only generate noise in the communication. – user1849534 Jan 03 '13 at 17:39
Both the ISO C11 and ISO C++11 have been ratified as the new ANSI C and C++ Standards.
For example, on my ANSI copy of C11 it is written:
Adopted by INCITS (InterNational Committee for Information Technology Standards) as an American National Standard. Date of ANSI Approval: 5/23/2012

- 142,963
- 15
- 272
- 331
-
-
2
-
1@user1849534 C11 has been approved as the new ISO C Standard on December 2011, and ANSI approves it on May 2012. ISO and ANSI are two different organizations with different goals. – ouah Jan 03 '13 at 15:45
-
1@user1849534: ISO is international (based in Switzerland). ANSI is American (based in Washington). They can't be the same now can they? ;-) – netcoder Jan 03 '13 at 15:46
-
1@user1849534 You could say `ANSI ∈ ISO` without becoming totally wrong. – Daniel Fischer Jan 03 '13 at 15:49
-
2@user1849534: the current ISO C standard is the current ANSI C standard, but you can't "subtract `C standard` from both sides" to conclude that ISO and ANSI are the same ;-) – Steve Jessop Jan 03 '13 at 16:08
-
Since currently1 3 different revisions of the C standard and "two and a half" of the C++ one are widely used, I'd say that such terminology today makes less sense than ever.
- Actually, at a given time there's only one "current" C (C++) standard, the last one, since it supersedes the previous versions. What I'm saying about here is that all these previous versions are still very much relevant (often more than the latest revision).

- 123,740
- 17
- 206
- 299
-
1"Currently", there is only one ISO C standard and only one ISO C++ standard. All the others have been withdrawn by ISO and - as I understand it - by ANSI as well. – CB Bailey Jan 03 '13 at 15:39
-
@Gorpik well if the C++03 it's a minor update I suppose that the TR1 it's a tiny patch then – user1849534 Jan 03 '13 at 15:40
-
I suppose i can consider this 2 organizations the same organization now – user1849534 Jan 03 '13 at 15:41
-
-
@user no, you cannot. There is a reason one has "National" in the name and the other has "International" in the name. There other nations taking part in ISO. – R. Martinho Fernandes Jan 03 '13 at 15:45
-
What @CharlesBailey said, "This third edition **cancels and replaces** the second edition, ISO/IEC 9899:1999, as corrected by ISO/IEC 9899:1999/Cor 1:2001, ISO/IEC 9899:1999/Cor 2:2004, and ISO/IEC 9899:1999/Cor 3:2007." – Daniel Fischer Jan 03 '13 at 15:47
-
1@CharlesBailey: ISO and ANSI may retire whatever they want, but this doesn't change the fact that C++98/03 and C89 are still the most relevant revisions in terms of written code, and very often you have to resort to them for compatibility reasons (or because compiler writers don't care - will VC++ ever move after C89?) . Also, I have yet to see a completely conforming C++11 or C11 compiler. So, "currently" *there are* 4/5 standards to keep in mind. – Matteo Italia Jan 03 '13 at 15:48
-
@Matteo: Indeed. Even if older versions are some sense technically not an ISO standard any more that makes no practical difference whatever. It can be used as though it were, and for example C++03 is still the published version of C++ that comes closest to having an implementation. Old standards don't magically cease to exist -- for that matter C++11 *refers normatively to C99*. So C++ programmers can hardly act as though C99 is somehow no longer an ISO standard, or else various standard library functions aren't defined by ISO at all ;-) – Steve Jessop Jan 03 '13 at 15:50
-
@MatteoItalia at least now that `export` is out of the way we can at least hope there will be several highly conforming implementations. – R. Martinho Fernandes Jan 03 '13 at 15:52
-
1I'm not arguing with the fact that old revisions are important, but suggesting that old revisions are still "current" is a little misleading. – CB Bailey Jan 03 '13 at 15:54
-
@CharlesBailey: are not "current" for ISO, but they are "current" in practice, since the vast majority of coders still (have to) write everyday C++03 and C89 code. – Matteo Italia Jan 03 '13 at 15:56
-
Again, I'm not disagreeing; I was just pointing out a possible area for clarification in this answer. – CB Bailey Jan 03 '13 at 15:59
-
@R.MartinhoFernandes: secretly I believe that there will never be a completely conformant implementation of any C++ standard, but that's just my opinion. :) – Matteo Italia Jan 03 '13 at 16:00
-