New C Language: C99 Standard Introduction

zhaozj2021-02-16  42

New C Language: C99 Standard Introduction

Randy Meyers

This article is taken with the "new C language, C99 standard introduction" in "Dr.Dobb's software research and development", "" 2003), and the article mainly introduces the new characteristics of C99. Author Randy Meyers and "Dr.Dobb's Software R & D" "Mr. Liu Jiang's response, the previous part of the full text is published as documentation, I hope to help everyone.

Translation 2: C language generates from failure projects --- Multics. From the early C language from the early 1970s to the late K & R C, ANSI C, C89, in the nearly 20 years of C language evolution, until the 1999 C language and re-casement, becoming new C language standards. This article was published in Cuj OctorBer 2000 V18 N10. At that time, the C99 standard just announced that the C community is urgently needing orthodox sound. As a member of the Standard Commission, the author of the Standard Committee, in Cuj magazine, a special series of the New c is used to discuss the new characteristics of the new standard. This article is the first one. This article introduces new standard C, especially some increased features, and expects that this article can help Co-care C language and users who use C language. In the translation, all translators have doubtful terms in the translation process or everything in the form of parentheses, sincerely do not want to mislead readers, but if you still need readers, you can use everything in this article Amstrongest@hotmail.com Contacts and discusses the translator.

C99 is very similar to C89, which is consistent, but more is different.

Introduction

You may not notice that the main revision of ANSI / ISO C [1] has been approved in December last year, it is C99. Similarly, you may not notice, in fact, you are already using this new C language, or at least part of it. This needs to be attributed to the standard committee to adopt an appropriate and conservative approach in receiving new features to C language. Almost all new features have already been implemented and its existing value is proved in some of the existing C compilers (IMPletmentations). Although there is no compiler to ensure all C99 features, many of them have achieved different parts in C99 many years ago. This will be a good news for C programmers. Perhaps you have avoided using some independent features in your favorite compiler, but now you can use these features if these features are part of C99, you can use these features because they will be in big Part of the compiler of the C99 standard is guaranteed. There is no doubt that the new standard is an older, of course, it will be some incompatible, but these are very few and secondary. The Standards Committee works very hard to reduce the impact to the influence of compatibility with old versions to minimize. You can see this aspect from the keywords discussed later.

Naming and history

The programming language is continuously evolved over time. The language naming method is not only on the name of the language itself, but also combines them to be defined. (Back five years ago, Algol 68, C89, Fortran 77 also had Fortran 4, I really feel funny, now these annoying naming methods have brought thousands of worm problems, 04 will not distinguish 2004 or a long history of 1904). New C language and definition Its new standard is called C99, and the original C language standard [2] is called C89 or C90 (ANSI announced standard document in 1989 and ISO re-arranged the standard document section in 1990 Later, it was released. If you handle Japanese, Korean, or Chinese text issues in your own procedure, you may know that there is a small upgrade for C89 [3] is called C95, this upgrade is mainly joined more The library function used to handle multi-byte and wide character character (Wide and Multibyte Characters) (Java's advocate once wrongfully announced that Java is the first language that supports big character sets, in fact, this support is already in C89 Exist). The maximum impact on C99 is perhaps the numerical C extensions group, or nceg.). Nceg is a sub-committee of the ANSI C Standards Committee, who mainly engages in technical reports after the completion of C89 [4]. NCEG's technical report is not standard, it is just calling on compiler implementors to experience and get experience in a series of clear language features. The large part of these extensions is used to process the IEEE ARITHMETIC, Complex Numbers, but there are some for other general goals or performance enhancements and optimizations (becoming long arrays, parallel processing, restrict keywords) .

NCEG's extension is the first defined by the sub-standard committee, and others are redifunged based on the feedback of the compiler vendor for the feature that has been implemented. So the technical report is not standard, and the compiler vendor can freely select and implement these extensions, and can even change these extensions according to user experience.

The demand for real world is very valuable. Different features of the language will interact in a surprising manner, while some features will bring adverse effects to the operational efficiency of the program, even if these features will never be used (for example, Some C implementations, using a small amount of multiple inherited programs will slower than only the single inherited program). The NCEG expansion experiment is not only to improve the expansion itself, but also to improve their specifications, and keep the Standards Committee keep confidence in the internal role and value of those known language features.

Which are not c99

Not all NCEG extensions are accepted by C99, the biggest example may be that NCEG's support for parallel processing is not accepted by C99. These parallel processing is based on the C * language (read as C-Star) on Thinking Machines. In order to make the programmer to make many different extension characteristics, the NCEG technology report has not improved this, so there is still no consistent and the best way to do in parallel Programming on the computer. Therefore, such characteristics are not suitable for acceptable by standard C language. Other NCEG extensions have made some changes before being added to C99. NCEG supports multiplexes contain separate imaginary data (Separate Imaginary DataTypes). For example, the Double_ Imaginary data type. But in the C99, the viable data type is optional.

However, it is considered that the most ended that the characteristics not adopted by C99 are not from NCEG, but C . In the past year, the Standards Committee has been engaged in subset in C - the research work for object-oriented characteristics. This subset is a bit like a mixture of C features at the end of the 1980s, including single inheritance (non-multi-inheritance), virtual functions, member access control (public, private, protection), constructor, and destructor. If the new C language is similar to the early C , it is said that both progress is also retreat. A positive side is that these features have played a huge role in the popularity of the initial C , and now the value of these features and the inherent effects of them have been well understood, and they have proven that they can coexist. However, the negative side is "Can C in the 1990s as a natural evolution of C in the 1980s? If so, C 's characteristic value of C in the 1980s? To know that we already have C in the 1990s." In the end, many reasons, including some logic, allowing the Standards Commission to refuse to add object-oriented characteristics to the C language. Randy Meyers is consultant providing training and mentoring in C, C , and Java. He is the current chair of J11, the ANSI C committee, and previously was a member of J16 (ANSI C ) and the ISO Java Study Group. He worked on Compilers for Digital Equipment Corporation for 16 Years and Was Project Architect For Dec C and C . He Can Be Reached At RMEYERS@ix.netcom.com.

转载请注明原文地址:https://www.9cbs.com/read-22745.html

New Post(0)