C、C99、ANSI C 和 GNU C 之间有什么区别? [英] What is the difference between C, C99, ANSI C and GNU C?

查看:27
本文介绍了C、C99、ANSI C 和 GNU C 之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开始在 codechef 上进行编程练习,并且已经被 C 和 C99 之间的差异所迷惑.C在这里是什么意思?是 C89 吗?检查此提交底部的语言.它包含 C 和 C99.

I have started programming practice on codechef and have been confused by the difference between C and C99. What does C mean here? Is it C89? Check the languages at the bottom of this submit. It contains both C and C99.

我在 Internet 上发现了一种叫做 GNU C 的东西.Linux/unix 系统是否有不同的 C?这些是否符合 ANSI 的 C 标准?我也在一些地方读过C99严格".这是什么?

I found on the internet something called GNU C. Is there a different C for linux/unix systems? Are these compliant to the C standards by ANSI? I have also read in some places "C99 strict". What is this?

是否还有其他不同的 C 标准在使用?有没有叫 C 4.3.2 的东西,还是当前使用的 gcc 版本?

Are there any other different standards of C in use? Is there something called C 4.3.2 or is it the gcc version in current use?


这个这个这个 有帮助.我会搜索更多内容并编辑未答复的内容.

This, This, This helped. I'll search more and edit the things that are left unanswered.

我不是编程新手.我知道什么是C语言.我知道 ANSI 有不同的 C 标准,如 C89、C99 和 C11.

I am not a programming newbie. I know what C language is. I know that there are the different C standards by ANSI like C89, C99 and C11.

推荐答案

  • 标准化之前的一切通常被称为K&R C",以著名的书(第一版第二版),与丹尼斯C语言的发明者Ritchie作为作者之一.这就是C 语言".1972-1989 年.

    • Everything before standardization is generally called "K&R C", after the famous book (1st edition and 2nd edition), with Dennis Ritchie, the inventor of the C language, as one of the authors. This was "the C language" from 1972-1989.

      第一个 C 标准于 1989 年在美国全国发布,由其国家标准机构 ANSI 发布.此版本称为 C89 或 ANSI-C.从 1989 年到 1990 年,这是C 语言".

      The first C standard was released 1989 nationally in USA, by their national standard institute ANSI. This release is called C89 or ANSI-C. From 1989-1990 this was "the C language".

      次年,美国标准被国际接受并由 ISO (ISO 9899:1990) 发布.此版本称为 C90.从技术上讲,它与 C89/ANSI-C 的标准相同.正式地,它取代了 C89/ANSI-C,使它们过时了.从 1990 年到 1999 年,C90 是C 语言".

      The year after, the American standard was accepted internationally and published by ISO (ISO 9899:1990). This release is called C90. Technically, it is the same standard as C89/ANSI-C. Formally, it replaced C89/ANSI-C, making them obsolete. From 1990-1999, C90 was "the C language".

      请注意,自 1989 年以来,ANSI 与 C 语言没有任何关系.程序员仍在谈论ANSI C"一般不知道这意味着什么.ISO拥有"C 语言,通过标准 ISO 9899.

      Please note that since 1989, ANSI haven't had anything to do with the C language. Programmers still speaking about "ANSI C" generally haven't got a clue about what it means. ISO "owns" the C language, through the standard ISO 9899.

      1995 年发布了一个小更新,有时称为C95".这不是重大修订,而是正式命名为 ISO/IEC 9899:1990/Amd.1:1995 的技术修订.主要的变化是引入了宽字符支持.

      A minor update was released in 1995, sometimes referred to as "C95". This was not a major revision, but rather a technical amendment formally named ISO/IEC 9899:1990/Amd.1:1995. The main change was introduction of wide character support.

      1999 年,C 标准进行了重大修订(ISO 9899:1999).此版本的标准称为 C99.从 1999 年到 2011 年,这是C 语言".

      In 1999, the C standard went through a major revision (ISO 9899:1999). This version of the standard is called C99. From 1999-2011, this was "the C language".

      2011 年,C 标准再次更改(ISO 9899:2011).此版本称为 C11.该语言添加了各种新功能,例如 _Generic_Static_assert 和线程支持.此次更新非常关注多核、多处理和表达排序.从 2011 年到 2017 年,这是C 语言".

      In 2011, the C standard was changed again (ISO 9899:2011). This version is called C11. Various new features like _Generic, _Static_assert and thread support were added to the language. The update had a lot of focus on multi-core, multi-processing and expression sequencing. From 2011-2017, this was "the C language".

      2017 年,C11 进行了修订,解决了各种缺陷报告.该标准非正式地称为 C17 或 C18.它于 2017 年完成(并使用 __STDC_VERSION__ = 201710L)但由 ISO 发布为 9899:2018,因此 C17/C18 之间存在歧义.它不包含任何新功能,只是更正.它是 C 语言的当前版本.

      In 2017, C11 was revised and various defect reports were solved. This standard is informally called C17 or C18. It was finished in 2017 (and uses __STDC_VERSION__ = 201710L) but was released by ISO as 9899:2018, hence the ambiguity between C17/C18. It contains no new features, just corrections. It is the current version of the C language.

      C99 严格"可能是指编译器设置强制编译器通过字母遵循标准.C 标准中有一个术语符合实现.本质上它的意思是:这个编译器实际上正确地实现了 C 语言".正确实现 C 语言的程序正式称为严格符合程序.

      "C99 strict" likely refers to a compiler setting forcing a compiler to follow the standard by the letter. There is a term conforming implementation in the C standard. Essentially it means: "this compiler actually implements the C language correctly". Programs that implement the C language correctly are formally called strictly conforming programs.

      GNU C"可能意味着两件事.作为 GNU 编译器集合 (GCC) 的一部分提供的 C 编译器本身.或者它可能意味着 GCC C 编译器使用的非标准默认设置.如果您使用 gcc program.c 进行编译,那么您不会根据 C 标准进行编译,而是根据非标准的 GNU 设置进行编译,这可能被称为GNU C".例如,整个 Linux 内核是用非标准的 GNU C 编写的,而不是用标准的 C 编写的.

      "GNU C" can mean two things. Either the C compiler itself that comes as part of the GNU Compiler Collection (GCC). Or it can mean the non-standard default setup that the GCC C compiler uses. If you compile with gcc program.c then you don't compile according to the C standard, but rather a non-standard GNU setup, which may be referred to as "GNU C". For example, the whole Linux kernel is made in non-standard GNU C, and not in standard C.

      如果你想按照 C 标准编译你的程序,你应该输入 gcc -std=c99 -pedantic-errors.如果您的 GCC 版本支持,请将 c99 替换为 c11.

      If you want to compile your programs according to the C standard, you should type gcc -std=c99 -pedantic-errors. Replace c99 with c11 if your GCC version supports it.

      这篇关于C、C99、ANSI C 和 GNU C 之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆