developer tip

C, C99, ANSI C와 GNU C의 차이점은 무엇입니까?

optionbox 2020. 7. 25. 10:51
반응형

C, C99, ANSI C와 GNU C의 차이점은 무엇입니까?


codechef에서 프로그래밍 연습을 시작했으며 C와 C99차이점 으로 인해 혼란스러워했습니다 . 여기서 C는 무엇을 의미합니까? C89입니까? 이 제출서 하단의 언어를 확인하십시오 . C와 C99를 모두 포함합니다.

인터넷에서 GNU C라는 것을 발견했습니다. 리눅스 / 유닉스 시스템을위한 다른 C가 있습니까? 이것들은 ANSI에 의해 C 표준을 준수합니까? 나는 또한 일부 장소에서 "C99 strict"를 읽었습니다. 이게 뭐야?

사용중인 다른 C 표준이 있습니까? C 4.3.2라는 것이 있습니까 아니면 현재 사용중인 gcc 버전입니까?

편집하다:

이것 , 이것 , 이것은 도움 되었습니다. 더 많은 정보를 검색하고 답변하지 않은 내용을 편집하겠습니다.

나는 프로그래밍 초보자가 아닙니다. 나는 C 언어가 무엇인지 안다. C89, C99 및 C11과 같이 ANSI에 따라 다른 C 표준이 있음을 알고 있습니다.


  • 표준화 이전의 모든 것을 유명한 책 뒤에 C 언어의 발명가 인 Dennis Ritchie와 함께 "K & R C"라고 합니다. 이것은 1972-1989 년의 "C 언어"였습니다.

  • 최초의 C 표준은 미국의 국가 표준 기관인 ANSI에 의해 1989 년 미국에서 발표되었습니다. 이 릴리스를 C89 또는 ANSI-C라고합니다. 1989-1990 년에는 이것이 "C 언어"였습니다.

  • 다음 해에 미국 표준은 국제적으로 인정되어 ISO (ISO 9899 : 1990)에 의해 출판되었습니다. 이 릴리스를 C90이라고합니다. 기술적으로 C89 / ANSI-C와 동일한 표준입니다. 공식적으로 C89 / ANSI-C를 대체하여 더 이상 사용하지 않습니다. 1990 년부터 1999 년까지 C90은 "C 언어"였습니다.

    1989 년 이후 ANSI는 C 언어와 아무 관련이 없었습니다. 여전히 "ANSI C"에 대해 말하는 프로그래머는 일반적으로 그것이 의미하는 바에 대한 단서를 얻지 못했습니다. ISO는 표준 ISO 9899를 통해 C 언어를 "소유"합니다.

  • 1995 년에 마이너 업데이트가 릴리스되었으며 때때로 "C95"라고도합니다. 이것은 주요 개정이 아니라 공식적으로 ISO / IEC 9899 : 1990 / Amd.1 : 1995라는 기술적 개정이었습니다. 주요 변경 사항은 광범위한 문자 지원 도입이었습니다.

  • 1999 년 C 표준은 주요 개정 (ISO 9899 : 1999)을 거쳤습니다. 이 표준 버전을 C99라고합니다. 1999 년부터 2011 년까지이 언어는 "C 언어"였습니다.

  • 2011 년에 C 표준이 다시 변경되었습니다 (ISO 9899 : 2011). 이 버전을 C11이라고합니다. 다양한 새와 같은 기능 _Generic, _Static_assert및 스레드 지원 언어에 추가되었습니다. 이 업데이트는 멀티 코어, 멀티 프로세싱 및 표현식 시퀀싱에 중점을 두었습니다. 2011 년부터 2017 년까지 "C 언어"였습니다.

  • 2017 년 C11이 개정되어 다양한 결함 보고서가 해결되었습니다. 이 표준은 비공식적으로 C17이라고하며 ISO 9899 : 2018으로 출시되었습니다. 새로운 기능이없고 수정 만 포함합니다. C 언어의 현재 버전입니다.


"C99 엄격"은 컴파일러가 문자를 기준으로 표준을 따르도록하는 컴파일러 설정을 의미합니다. C 표준에는 적합한 구현 이라는 용어가 있습니다. 기본적으로 "이 컴파일러는 실제로 C 언어를 올바르게 구현합니다"를 의미합니다. C 언어를 올바르게 구현하는 프로그램을 공식적으로 엄격하게 준수하는 프로그램 이라고 합니다 .

"GNU C"는 두 가지를 의미 할 수 있습니다. GCC (GNU Compiler Collection)의 일부로 제공되는 C 컴파일러 자체입니다. 또는 GCC C 컴파일러가 사용하는 비표준 기본 설정을 의미 할 수 있습니다. 로 컴파일 gcc program.c하면 C 표준에 따라 컴파일되지 않고 "GNU C"라고하는 비표준 GNU 설정에 따라 컴파일됩니다. 예를 들어, 전체 Linux 커널은 표준 C가 아닌 비표준 GNU C로 만들어집니다.

C 표준에 따라 프로그램을 컴파일하려면을 입력해야합니다 gcc -std=c99 -pedantic-errors. GCC 버전에서 지원하는 경우 c99를 c11로 교체하십시오.


ANSI C에 대해서는 반드시 응답해야합니다. ANSI는 아무런 작업을 수행하지 않았지만 컴파일러는 여전히 빌드되어 있습니다. PIC XC16 컴파일러 예 : "컴파일러는 ANSI 사양 (ANSI x3.159-1989)에 의해 정의되고 Kernighan and Ritchie의 The C Programming Language (제 2 판)에 설명 된대로 ANSI C 표준을 준수하는 완전히 검증 된 컴파일러입니다. ... "모든 프로그래밍이 PC와 같은"큰 "컴퓨터를위한 것은 아닙니다. 장치 비용에 대한 컴파일러 작성 및 비용 시간 및 $ 유효성 검사 ANSI C는 임베디드 / 실시간 장치에서 살아 있고 잘 작동합니다.


  • ANSI C : 최초의 C 언어는 1989 년 ANSI라는 본문에 의해 표준화되었으므로 c89라고합니다.

  • C99 :
    with the demand from the developers requirements, in 1999-2000 further or additional keywords and features have been included in C99 (ex: inline, boolean.. Added floating point arthematic library functions)

  • GNU C: GNU is a unix like operating system (www.gnu.org) & somewhere GNU's project needs C programming language based on ANSI C standard. GNU use GCC (GNU Compiler Collection) compiler to compile the code. It has C library function which defines system calls such as malloc, calloc, exit...etc

ANSI C is a standard which is being used by or refereed the other standards.


In Addition To Lundin Answer

Here is What Dennis Richie Has To Say When Asked

"Why didn't K&R wait for the final, approved ANSI standard before writing K&R 2nd edition?"

Why didn't K&R wait for the final, approved ANSI standard before writing K&R 2nd edition? It seems like this book will only be the correct standard for a few months before it will be supesceded by the final ANSI standard. I know that there are likely to be few major changes at this late stage, but why not wait a few months and make sure you get it 100% right, rather than needing to almost immediately write a 3rd edition or be obsolete?

We thought it would be nice to mark the 10th anniversary of the first edition. More seriously, we started work last summer because we had the time and inclination then, and it appeared that X3J11 was approaching an end. In December and January, as we were finishing, we considered whether the possibility of important changes warranted putting off delivery, and (after discussing the matter with the publisher) decided that it was not worth waiting. P-H wanted it, and both Brian and I wanted it off our agendas.

Even if there are changes in the standard, it's hard to imagine that they would be extensive enough to warrant a new edition. (We were even prepared to cope somehow with noalias, if it had lasted.) We're ready to make necessary changes in a future printing, but there's reason to hope that they should be minor. X3J11's members are very anxious to finish without surprising people, too; many of them work for companies that are preparing ANSI compilers, after all.

Dennis Ritchie


This question was not thoroughly searched on net for answer ,anyway you may look at this :

  1. C is a general-purpose programming language initially developed by Dennis Ritchie between 1969 and 1973 at AT&T Bell Labs.
  2. C99 is a standard of the C language published by ISO and adopted by ANSI in around 1999.
  3. GNU C is just an extension of c89,while some features of c99 are also added,but in entirety it is different from c99 standard so when compiling in gcc we have to enter -std=c99 which is already mentioned in the other answers.
  4. ANSI C is a successive series of standards released by ANSI.

참고URL : https://stackoverflow.com/questions/17206568/what-is-the-difference-between-c-c99-ansi-c-and-gnu-c

반응형