0

I wanted to learn more about C and instead of getting a rehash in form of a book about C, I wanted to read the "Standard that compilers are actually implementing". This seems to be ISO/IEC 9899:2011 Document, currently available on their website for 198 CHF.

This bothered me, as after a quick search I realized that the "C11" standard seems to be not publicly available. Open-std.org lists only this document as "...reflects what was to become the standard at the time of issue.", but not the actual standard.

Now my question:

  • Which Standard exactly are the open-source compilers (especially clang and gcc) implementing?
  • Where can I find this standard?

And in case open-source compilers implement a standard that is not publicly available:

  • Why exactly is a open-source compiler implementing a non-public standard? Does that not greatly prevent people from contributing code or fully understanding the code, which I think is the purpose of open-source. Given all the hours spend on coding and then giving away the code, surely some hours can be spend on writing a standard instead of code.
Paul Pauls
  • 710
  • 1
  • 4
  • 19
  • the document preceeding the final standard is fine – Karoly Horvath Jan 04 '17 at 16:40
  • 2
    They standard committee has to charge for the standard in a quirk of how standardization works. They are working to make the actual standard free instead of having to charge it. That said you can get by with the draft the was published right before the release of the standard. That will be right 99.9% of the time. Also, if you really want to get into the nitty gritty details paying for the standard is not really a big deal. It's about the cost of a good textbook. – NathanOliver Jan 04 '17 at 16:40
  • I knew that question would get downvoted given the lack of info I found online - still, please answer my ignorance =) – Paul Pauls Jan 04 '17 at 16:40
  • 3
    my reason for downvoting: https://www.google.hu/search?q=c+standard+stackoverflow – Karoly Horvath Jan 04 '17 at 16:42
  • 1
    This is half dupe, half lack of reading compiler documentation, and half off-topic rant about how everything should cost nothing to consume. Yes, three halves :D – Lightness Races in Orbit Jan 04 '17 at 16:43
  • @NathanOliver, so they are working on making the standard ISO/IEC 9899:2011 public but currently can't due to "politics"? So the compilers do really implement exactly this standard? – Paul Pauls Jan 04 '17 at 16:43
  • 2
    @DimBimJim I doubt any compiler is 100% standard compliant but they try to be. As far as what standard is implemented it is actually multiple. It is controlled with compiler flags like `-std=c99` or `-std=c11` so you can compile the same code to different standards on the same compiler. – NathanOliver Jan 04 '17 at 16:46
  • 1
    @KarolyHorvath, well thank you for giving me that google search, I obviously just guessed the price of the document right. – Paul Pauls Jan 04 '17 at 16:46
  • @DimBimJim The developers of "large" compilers and toolchains are probably willing to pay for access to the official document. It's not like it's hidden anyway -- it's just behind a paywall, like many scientific papers etc. – Theodoros Chatzigiannakis Jan 04 '17 at 16:46
  • I'm not rambling about software costing money, of course that's fine. It's rather that an "Open" software orientes on a "closed" document. Though I did really not know exactly in which stackexchange subcategory this was supposed to go. – Paul Pauls Jan 04 '17 at 16:50
  • You get downvotes mostly for doing no research at all. The gcc as well as clang documentation are very clear about whihc standard they implement. And a simple search for "c standard" or "c++ standard" directly lead to the documents. If you don't want to pay for them is a secondary problem and can be solved by another simple search for the differences between the drafts and the standard. – too honest for this site Jan 04 '17 at 16:51
  • @DimBimJim: you should talk to your gouvernment. ISO and IEEE are financed by public funds. It is not the compiler which handle it wrong, but the standardisation organisations. It was fine years ago when there were effective costs for distribution, but now those are negligible - at least for online-publishing. – too honest for this site Jan 04 '17 at 16:54
  • Open is not a synonym of free. The C standard is open in the sense that you can obtain a copy of the text and implement your own compiler. Can you find Delphi's specification and make your own Delphi IDE? – giusti Jan 04 '17 at 16:54
  • 1
    @NathanOliver: I believe the Final Committee Draft has to be character-by-character identical with the actual standard *apart* from some material at the front. The National Bodies can either accept or reject the FCD - they don't get an opportunity to "edit it just a bit". – Martin Bonner supports Monica Jan 04 '17 at 16:55
  • @Olaf This is a huge can of worms. Do we have time to discuss open access to all scientific paper publications too? – giusti Jan 04 '17 at 16:55
  • @MartinBonner If that is true that is good to know. I though I had heard there could be some very small differences but it should not affect anything. – NathanOliver Jan 04 '17 at 16:56
  • 1
    @giusti: It is and it is a political thing. There are countries which require publically financed information to be free. Not sure about you, but I think this is much better way to spend my taxes than financing weapons, and wars. – too honest for this site Jan 04 '17 at 16:58
  • @NathanOliver Sorry. What I said was true ... but the FCD is the one committee draft that is *not* open access - so you have to look at the draft before that (which will obviously be slightly different). Bother. – Martin Bonner supports Monica Jan 04 '17 at 16:58
  • @MartinBonner Okay. So the most current draft is the draft right before the FCD and there can be different? – NathanOliver Jan 04 '17 at 16:59
  • @Olaf I'm very interested in that subject, actually, and I do agree with you. I find it absurd that I have to use government money to pay Springer/IEEE/etc to have the results of my government-funded projects published in a conference that was organized by a University with public money. – giusti Jan 04 '17 at 17:00
  • 1
    @NathanOliver: The difference bnetween the final draft and the standard document is just two constant macros related to the C version (iirc the draft uses something like a value of `201X`, while the standard uses `2011`. I think there is a corrigendum about those two changes for download (or there even are comments about the expected value int th draft). The other is similar. Both are irrelevant for 99,99% of all clode. – too honest for this site Jan 04 '17 at 17:00
  • Again because I want to clarify: I see nothing wrong in making money with scientific papers/software etc. Just that I find it hard to believe that such a huge open-source software is build upon a document one has to pay 200CHF for. @NathanOliver, thank you, I knew about the standard flags. What would rather interest me is if the -std=c11 standard is based upon the "free" document linked in open-std.org or the ISO/IEC 9899:2011 one has to pay for or rather their slightly own adjusted standard. – Paul Pauls Jan 04 '17 at 17:05
  • @Olaf, thank you about the note about the two different macros! I will now pressume that both compilers implement the ISO/IEC 9899:2011 paid standard. – Paul Pauls Jan 04 '17 at 17:07
  • @DimBimJim Honestly I do not think there is one document you could point to and say the compiler implements that standard. As the standard evolves/is used all sorts of defects are found and changes are requested. If it looks like that change is going to make it into the standard then a lot of compilers implement it even though it is not standard yet. Most likely they are using the the actual standard but the latest draft would do you just as well. – NathanOliver Jan 04 '17 at 17:11
  • @DimBimJim: You confuse cause and effect. What do you expect a **C** compiler to implement if not what the **C** standard specifies? ANd why do you complain here? Afaik stack overflow is no way affiliated with IEEE, IEC, ISO etc. You should complain there. – too honest for this site Jan 04 '17 at 17:13
  • @NathanOliver: Still there is only one standard. – too honest for this site Jan 04 '17 at 17:14
  • One for the way: There is only **one** C standard and one C++ standard. So there is no other _standard_ to implement. – too honest for this site Jan 04 '17 at 17:21
  • Despite assertions in these comments about government funding, both ISO and IEEE are private-sector organizations, funded by member dues and sales of standards documents. – Pete Becker Jan 04 '17 at 17:22

1 Answers1

0

See the following articles:

The Standard

The current ISO C++ standard is officially known as ISO International Standard ISO/IEC 14882:2014(E) – Programming Language C++.

...

Q: Why are the C++ working drafts freely available on GitHub when the standard must be purchased from ISO or another standards organization?

ISO holds the copyright for all balloted drafts of the standard, as well as the standard itself. The GitHub repo contains the incremental in-progress working source snapshots as they are edited, which are not the final standards.

The only documents that the C++ committee is not permitted to provide freely are the final published standards. The draft repository on GitHub does not contain the final source for any published standards. It contains interim working materials only, and those differ in their contents from the published standards.

Where can you get the ISO C++ standard, and what does “open standard” mean?.

Today’s question comes from someone who recently asked about why, if ISO C++ is an open standard, ISO charges for it and we can’t just download it for free.

The short answer is that people sometimes confuse “open” with “free.” ISO standards aren’t “open” like the O in FOSS, they’re “open” like “not developed behind closed doors.” Anyone who wants to pay for membership in their national body (if their country participates in ISO and in the specific project in question) is able to come join the fun. In free-as-in-beer terms, this means that experts are welcome to come to the ISO brewery at their own expense and volunteer their time to help brew the beer, and then when the beer is ready the customers still pay ISO to drink it (the helpers don’t get a cut of that, only a free bottle for their personal use and the satisfaction of having brewed a mighty fine keg).

...

ISO C++ claims to be an OPEN STANDARD. Where can I download the OPEN STANDARD for ISO C++.

All published ISO standards are available for sale from the ISO store, via http://iso.org.

So, while the official standard is public, the final release is not free, only the working drafts and other intermediate papers are. You have to pay to access the final standard (unless you find a bootleg copy).

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770