gpt4 book ai didi

c++ - 他们实现的开源 C 编译器(gcc、clang)的实际标准在哪里?

转载 作者:行者123 更新时间:2023-11-30 16:51:57 25 4
gpt4 key购买 nike

我想了解更多关于 C 的知识,而不是以一本关于 C 的书的形式重新学习,我想阅读“编译器实际实现的标准”。这似乎是 ISO/IEC 9899:2011 文件,目前在他们的网站上售价 198 瑞士法郎。

这让我很困扰,因为经过快速搜索后我意识到“C11”标准似乎并未公开。 Open-std.org 仅列出 this document因为“......反射(reflect)了发布时将成为标准的内容。”,但不是实际的标准。

现在我的问题:

  • 开源编译器(尤其是 clang 和 gcc)到底执行哪个标准?
  • 在哪里可以找到该标准?

如果开源编译器实现了不公开的标准:

  • 到底为什么开源编译器要实现非公开标准?这是否极大地阻碍了人们贡献代码或完全理解代码,我认为这就是开源的目的。考虑到所有的时间都花在编码上,然后分发代码,当然可以花一些时间来编写标准而不是代码。

最佳答案

请参阅以下文章:

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++.

所有已发布的 ISO 标准均可通过 ISO 商店购买 http://iso.org

因此,虽然官方标准是公开,但最终版本并不是免费,只有工作草案和其他中间文件是免费的。您必须付费才能访问最终标准(除非您找到盗版拷贝)。

关于c++ - 他们实现的开源 C 编译器(gcc、clang)的实际标准在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41468934/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com