词条 | C99 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
释义 |
C99 (previously known as C9X) is an informal name for ISO/IEC 9899:1999, a past version of the C programming language standard.[1] It extends the previous version (C90) with new features for the language and the standard library, and helps implementations make better use of available computer hardware, such as IEEE 754-1985 floating-point arithmetic, and compiler technology.[2] The C11 version of the C programming language standard, published in 2011, replaces C99. HistoryAfter ANSI produced the official standard for the C programming language in 1989, which became an international standard in 1990, the C language specification remained relatively static for some time, while C++ continued to evolve, largely during its own standardization effort. Normative Amendment 1 created a new standard for C in 1995, but only to correct some details of the 1989 standard and to add more extensive support for international character sets. The standard underwent further revision in the late 1990s, leading to the publication of ISO/IEC 9899:1999 in 1999, which was adopted as an ANSI standard in May 2000. The language defined by that version of the standard is commonly referred to as "C99". The international C standard is maintained by the working group ISO/IEC JTC1/SC22/WG14. DesignC99 is, for the most part, backward compatible with C89, but it is stricter in some ways.[3] In particular, a declaration that lacks a type specifier no longer has C99 introduced several new features, many of which had already been implemented as extensions in several compilers:[4]
Parts of the C99 standard are included in the current version of the C++ standard, including integer types, headers, and library functions. Variable-length arrays are not among these included parts because C++'s Standard Template Library already includes similar functionality. IEEE 754 floating-point supportA major feature of C99 is its numerics support, and in particular its support for access to the features of IEEE 754-1985 (also known as IEC 60559) floating-point hardware present in the vast majority of modern processors (defined in "Annex F IEC 60559 floating-point arithmetic"). Platforms without IEEE 754 hardware can also implement it in software.[2] On platforms with IEEE 754 floating point:
FLT_EVAL_METHOD == 2 tends to limit the risk of rounding errors affecting numerically unstable expressions (see IEEE 754 design rationale) and is the designed default method for x87 hardware, but yields unintuitive behavior for the unwary user;[8] FLT_EVAL_METHOD == 1 was the default evaluation method originally used in K&R C, which promoted all floats to double in expressions; and FLT_EVAL_METHOD == 0 is also commonly used and specifies a strict "evaluate to type" of the operands. (For gcc, FLT_EVAL_METHOD == 2 is the default on 32 bit x86, and FLT_EVAL_METHOD == 0 is the default on 64 bit x86-64, but FLT_EVAL_METHOD == 2 can be specified on x86-64 with option -mfpmath=387.) Before C99, compilers could round intermediate results inconsistently, especially when using x87 floating-point hardware, leading to compiler-specific behaviour;[9] such inconsistencies are not permitted in compilers conforming to C99 (annex F). ExampleThe following annotated example C99 code for computing a continued fraction function demonstrates the main features: Footnotes:
Version detectionA standard macro ImplementationsMost C compilers provide support for at least some of the features introduced in C99. Historically, Microsoft has been slow to implement new C features in their Visual C++ tools, instead focusing mainly on supporting developments in the C++ standards.[12] However, with the introduction of Visual C++ 2013 Microsoft implemented a limited subset of C99, which was expanded in Visual C++ 2015.[14]
Future workSince ratification of the 1999 C standard, the standards working group prepared technical reports specifying improved support for embedded processing, additional character data types (Unicode support), and library functions with improved bounds checking. Work continues on technical reports addressing decimal floating point, additional mathematical special functions, and additional dynamic memory allocation functions. The C and C++ standards committees have been collaborating on specifications for threaded programming. The next revision of the C standard, C11, was ratified in 2011.[39] The C standards committee adopted guidelines that limited the adoption of new features that have not been tested by existing implementations. Much effort went into developing a memory model, in order to clarify sequence points and to support threaded programming. See also{{Portal|Computer programming}}
References1. ^{{cite web|url=http://www.iso.org/iso/iso_catalogue/catalogue_ics/catalogue_detail_ics.htm?csnumber=29237 |title=ISO/IEC 9899:1999 - Programming languages - C |publisher=Iso.org |date=2011-12-08 |accessdate=2014-04-08}} 2. ^1 http://grouper.ieee.org/groups/754/meeting-materials/2001-07-18-c99.pdf 3. ^{{cite web|url=https://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Standards.html |title=Standards - Using the GNU Compiler Collection (GCC) |publisher=Gcc.gnu.org |date= |accessdate=2014-04-08}} 4. ^{{cite web|url=https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html |title=C Dialect Options - Using the GNU Compiler Collection (GCC) |publisher=Gcc.gnu.org |date=2009-05-06 |accessdate=2014-04-08}} 5. ^{{cite web |url=https://gcc.gnu.org/onlinedocs/gcc-3.3/gcc/Compound-Literals.html |title=Using the GNU Compiler Collection (GCC): Compound Literals |website=gnu.org |accessdate=31 January 2016}} 6. ^{{cite web |url=https://lwn.net/Articles/255364/ |title=What every programmer should know about memory |date=2007-10-23 |accessdate=2015-04-03 |author=Ulrich Drepper |publisher=LWN.net}} 7. ^{{cite book | url=http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf | title=ISO/IEC 9899:1999 specification, TC3 | at=p. 119, § 6.7.5.3 Function declarators (including prototypes) para. 7}} 8. ^{{cite web|url=http://www.validlab.com/goldberg/addendum.html|title=Differences Among IEEE 754 Implementations|author=Doug Priest|year=1997}} 9. ^{{cite web|url=http://drdobbs.com/architecture-and-design/184410314 | title=A conversation with William Kahan. | author=Jack Woehr |date=1 November 1997}} 10. ^{{cite web |url=http://www.cs.berkeley.edu/~wkahan/ieee754status/baleful.pdf |title=The Baleful Effect of Computer Benchmarks upon Applied Mathematics, Physics and Chemistry| author=William Kahan |date=11 June 1996}} 11. ^{{cite web|url=http://www.cs.berkeley.edu/~wkahan/Mindless.pdf | title=How Futile are Mindless Assessments of Roundoff in Floating-Point Computation? | author=William Kahan |date=11 January 2006}} 12. ^{{cite web |website=Ars Technica |url=https://arstechnica.com/information-technology/2013/06/c99-acknowledged-at-last-as-microsoft-lays-out-its-path-to-c14/ |title=C99 acknowledged at last as Microsoft lays out its path to C++14 |author=Peter Bright |date=29 June 2013 |accessdate=9 January 2015}} 13. ^{{cite web|url=http://developer.amd.com/cpu/open64/onlinehelp/pages/x86_open64_help.htm#Standards |title=x86 Open64 |publisher=Developer.amd.com |date=1 April 1989 |accessdate=8 June 2009}} 14. ^{{cite web|url=http://www.cc65.org/#Features|title=cc65 - a freeware C compiler for 6502 based systems|accessdate=14 September 2011}} 15. ^{{cite web|url=http://www.softintegration.com/demos/chstandard/c99.html |title=C/C++ interpreter Ch C99 features |publisher=SoftIntegration, Inc. |date=15 February 2008 |accessdate=15 February 2008}} 16. ^{{cite web|url=http://clang.llvm.org/docs/UsersManual.html#c |title=Clang Compiler User's Manual |accessdate=14 October 2017}} 17. ^{{cite web|url=http://compcert.inria.fr/man/manual005.html#language-reference|title=CompCert C Documentation and User Manual v2.5|accessdate=12 September 2015}} 18. ^{{cite web|url=http://pp.info.uni-karlsruhe.de/firm/ |title=libfirm homepage |accessdate=4 Feb 2014}} 19. ^{{cite web|url=http://www.digitalmars.com/ctg/C-Language-Implementation.html|title=C Language Implementation - Digital Mars|accessdate=14 September 2011}} 20. ^{{cite web|url=https://gcc.gnu.org/c99status.html |title=Status of C99 features in GCC |publisher=Free Software Foundation, Inc. |date=12 June 2014 |accessdate=25 August 2014}} 21. ^{{cite web|url=https://gcc.gnu.org/gcc-4.6/c99status.html |title=Status of C99 features in GCC 4.6|publisher=Free Software Foundation, Inc. |date=23 May 2013 |accessdate=23 May 2013}} 22. ^{{cite web|url=https://gcc.gnu.org/gcc-4.7/c99status.html |title=Status of C99 features in GCC 4.7|publisher=Free Software Foundation, Inc. |date=23 May 2013 |accessdate=23 May 2013}} 23. ^{{cite web|url=https://gcc.gnu.org/wiki/FloatingPointMath|title=Semantics of Floating Point Math in GCC|date=20 July 2018|accessdate=12 August 2018}} 24. ^{{cite web|url=http://www-01.ibm.com/common/ssi/cgi-bin/ssialias?infotype=an&subtype=ca&supplier=897&appname=IBMLinkRedirect&letternum=ENUS202-161|title=IBM C for AIX, V6.0 Now Supports the C99 Standard|publisher=|accessdate=31 January 2016}} 25. ^{{cite web|url=http://www-01.ibm.com/software/awdtools/xlcpp/aix/features/|title=IBM - XL C/C++ for AIX|publisher=|accessdate=31 January 2016}} 26. ^{{cite web|url=http://www-01.ibm.com/support/docview.wss?uid=swg21408170|title=IBM Rational Logiscope support for C99 standard - United States|publisher=|accessdate=31 January 2016}} 27. ^1 2 {{cite web|last=Brenner|first=Pat|title=What's New for Visual C++ in Visual Studio 2015|url=https://msdn.microsoft.com/en-us/library/hh409293.aspx|publisher=Microsoft Developer Network|accessdate=27 April 2015|archiveurl=|archivedate=}} 28. ^{{cite web|url=http://herbsutter.com/2012/05/03/reader-qa-what-about-vc-and-c99/|title=Reader Q&A: What about VC++ and C99?|work=Sutter’s Mill|accessdate=31 January 2016}} 29. ^{{cite web|url=http://msdn.microsoft.com/en-us/library/zb1574zs%28v=VS.100%29.aspx|title=A.27 Use of C99 Variable Length Arrays|publisher=Microsoft|accessdate=31 January 2016}} 30. ^{{cite web|url=http://www.infoq.com/news/2012/05/vs_c99_support|title=Microsoft to C99 Developers: Use ISO C++|work=InfoQ|accessdate=31 January 2016}} 31. ^{{cite web|url=http://blogs.msdn.com/b/vcblog/archive/2013/07/19/c99-library-support-in-visual-studio-2013.aspx|title=C99 library support in Visual Studio 2013|publisher=Microsoft|accessdate=31 January 2016}} 32. ^{{cite web|url=http://blogs.msdn.com/b/vcblog/archive/2013/06/28/c-11-14-stl-features-fixes-and-breaking-changes-in-vs-2013.aspx |title=C++11/14 STL Features, Fixes, And Breaking Changes In VS 2013 - Visual C++ Team Blog - Site Home - MSDN Blogs |publisher=Blogs.msdn.com |date=2013-06-28 |accessdate=2014-04-08}} 33. ^{{cite web|url=http://openwatcom.org/index.php/C99_Compliance |title=C99 compliance in Open Watcom |accessdate=25 September 2015 |deadurl=yes |archiveurl=https://web.archive.org/web/20150503232909/http://openwatcom.org/index.php/C99_Compliance |archivedate=3 May 2015 }} 34. ^{{cite web|url=http://www.smorgasbordet.com/pellesc/ |title=Pelles C Overview |date=January 2013}} 35. ^{{cite web|url=http://docs.oracle.com/cd/E19205-01/820-4155/c.html#about |title=Sun Studio 12: C Compiler 5.9 Readme |publisher=Sun Microsystems, Inc. |date=31 May 2007 |accessdate=23 September 2012}} 36. ^{{cite web|url=http://bellard.org/tcc/tcc-doc.html#SEC7|title=Tiny C Compiler Reference Documentation|publisher=|accessdate=31 January 2016}} 37. ^According to the project's TODO list complex types are the only missing C99 feature. Variable Length Arrays have been added in TCC 0.9.26 38. ^{{cite web|url=http://bellard.org/tcc/|title=TCC : Tiny C Compiler|publisher=|accessdate=31 January 2016}} 39. ^{{cite web|url=https://gcc.gnu.org/onlinedocs/gcc/Standards.html |title=Standards - Using the GNU Compiler Collection (GCC) |publisher=Gcc.gnu.org |date= |accessdate=2014-04-08}} Further reading
External links
3 : C (programming language)|Programming language standards|Unix programming tools |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。