CAN CSA-ISO IEC 9899-2013 Programming languages - C.pdf

上传人:unhappyhay135 文档编号:591075 上传时间:2018-12-15 格式:PDF 页数:712 大小:2.67MB
下载 相关 举报
CAN CSA-ISO IEC 9899-2013 Programming languages - C.pdf_第1页
第1页 / 共712页
CAN CSA-ISO IEC 9899-2013 Programming languages - C.pdf_第2页
第2页 / 共712页
CAN CSA-ISO IEC 9899-2013 Programming languages - C.pdf_第3页
第3页 / 共712页
CAN CSA-ISO IEC 9899-2013 Programming languages - C.pdf_第4页
第4页 / 共712页
CAN CSA-ISO IEC 9899-2013 Programming languages - C.pdf_第5页
第5页 / 共712页
亲,该文档总共712页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

1、Information technology Programming languages CCAN/CSA-ISO/IEC 9899:13(ISO/IEC 9899:2011, IDT)National Standard of CanadaNOT FOR RESALE. / PUBLICATION NON DESTINE LA REVENTE.Legal Notice for StandardsCanadian Standards Association (operating as “CSA Group”) develops standards through a consensus stan

2、dards development process approved by the Standards Council of Canada. This process brings together volunteers representing varied viewpoints and interests to achieve consensus and develop a standard. Although CSA Group administers the process and establishes rules to promote fairness in achieving c

3、onsensus, it does not independently test, evaluate, or verify the content of standards.Disclaimer and exclusion of liabilityThis document is provided without any representations, warranties, or conditions of any kind, express or implied, including, without limitation, implied warranties or condition

4、s concerning this documents fitness for a particular purpose or use, its merchantability, or its non-infringement of any third partys intellectual property rights. CSA Group does not warrant the accuracy, completeness, or currency of any of the information published in this document. CSA Group makes

5、 no representations or warranties regarding this documents compliance with any applicable statute, rule, or regulation. IN NO EVENT SHALL CSA GROUP, ITS VOLUNTEERS, MEMBERS, SUBSIDIARIES, OR AFFILIATED COMPANIES, OR THEIR EMPLOYEES, DIRECTORS, OR OFFICERS, BE LIABLE FOR ANY DIRECT, INDIRECT, OR INCI

6、DENTAL DAMAGES, INJURY, LOSS, COSTS, OR EXPENSES, HOWSOEVER CAUSED, INCLUDING BUT NOT LIMITED TO SPECIAL OR CONSEQUENTIAL DAMAGES, LOST REVENUE, BUSINESS INTERRUPTION, LOST OR DAMAGED DATA, OR ANY OTHER COMMERCIAL OR ECONOMIC LOSS, WHETHER BASED IN CONTRACT, TORT (INCLUDING NEGLIGENCE), OR ANY OTHER

7、 THEORY OF LIABILITY, ARISING OUT OF OR RESULTING FROM ACCESS TO OR POSSESSION OR USE OF THIS DOCUMENT, EVEN IF CSA GROUP HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, INJURY, LOSS, COSTS, OR EXPENSES.In publishing and making this document available, CSA Group is not undertaking to render pro

8、fessional or other services for or on behalf of any person or entity or to perform any duty owed by any person or entity to another person or entity. The information in this document is directed to those who have the appropriate degree of experience to use and apply its contents, and CSA Group accep

9、ts no responsibility whatsoever arising in any way from any and all use of or reliance on the information contained in this document. CSA Group is a private not-for-profit company that publishes voluntary standards and related documents. CSA Group has no power, nor does it undertake, to enforce comp

10、liance with the contents of the standards or other documents it publishes. Intellectual property rights and ownershipAs between CSA Group and the users of this document (whether it be in printed or electronic form), CSA Group is the owner, or the authorized licensee, of all works contained herein th

11、at are protected by copyright, all trade-marks (except as otherwise noted to the contrary), and all inventions and trade secrets that may be contained in this document, whether or not such inventions and trade secrets are protected by patents and applications for patents. Without limitation, the una

12、uthorized use, modification, copying, or disclosure of this document may violate laws that protect CSA Groups and/or others intellectual property and may give rise to a right in CSA Group and/or others to seek legal redress for such use, modification, copying, or disclosure. To the extent permitted

13、by licence or by law, CSA Group reserves all intellectual property rights in this document.Patent rightsAttention is drawn to the possibility that some of the elements of this standard may be the subject of patent rights. CSA Group shall not be held responsible for identifying any or all such patent

14、 rights. Users of this standard are expressly advised that determination of the validity of any such patent rights is entirely their own responsibility.Authorized use of this documentThis document is being provided by CSA Group for informational and non-commercial use only. The user of this document

15、 is authorized to do only the following:If this document is in electronic form:sLOADTHISDOCUMENTONTOACOMPUTERFORTHESOLEPURPOSEOFREVIEWINGITsSEARCHANDBROWSETHISDOCUMENTANDsPRINTTHISDOCUMENTIFITISIN0$ this remains the continuing responsibility of the SDO. An NSC reflects a consensus of a number of cap

16、able individuals whose collective interests provide, to the greatest practicable extent, a balance of representation of general interests, producers, regulators, users (including consumers), and others with relevant interests, as may be appropriate to the subject in hand. It normally is a standard w

17、hich is capable of making a significant and timely contribution to the national interest.Those who have a need to apply standards areencouraged to use NSCs. These standards are subjectto periodic review. Users of NSCs are cautionedto obtain the latest edition from the SDO which publishes the standar

18、d.The responsibility for approving standards as National Standards of Canada rests with theStandards Council of Canada270 Albert Street, Suite 200Ottawa, Ontario, K1P 6N7CanadaCette Norme nationale du Canada est offerte en anglais et en franais.Although the intended primary application of this Stand

19、ard is stated in its Scope, it is importantto note that it remains the responsibility of the users to judge its suitability for their particular purpose.TMA trade-mark of the Canadian Standards Association, operating as “CSA Group”TMA trade-mark of the Canadian Standards Association, operating as “C

20、SA Group”National Standard of CanadaPublished in January 2013 by CSA GroupA not-for-profit private sector organization5060 Spectrum Way, Suite 100, Mississauga, Ontario, Canada L4W 5N61-800-463-6727 416-747-4044Visit our Online Store at shop.csa.caApproved byStandards Council of CanadaCAN/CSA-ISO/IE

21、C 9899:13Information technology Programming languages CPrepared by InternationalOrganizationforStandardization/ International Electrotechnical CommissionReviewed byCAN/CSA-ISO/IEC 9899:13 Information technology Programm ing languages CCSA/4 2013 CSA Group January 2013CAN/CSA-ISO/IEC 9899:13Informati

22、on technology Programming languages CCSA PrefaceStandards development within the Information Technology sector is harmonized with international standards development. Through the CSA Technical Committee on Information Technology (TCIT), Canadians serve as the Canadian Advisory Committee (CAC) on ISO

23、/IEC Joint Technical Committee 1 on Information Technology (ISO/IEC JTC1) for the Standards Council of Canada (SCC), the ISO member body for Canada and sponsor of the Canadian National Committee of the IEC. Also, as a member of the International Telecommunication Union (ITU), Canada participates in

24、the International Telegraph and Telephone Consultative Committee (ITU-T).This Standard supersedes CAN/CSA-ISO/IEC 9899-02 (adoption of ISO/IEC 9899:1999).At the time of publication, ISO/IEC 9899:2011 is available from ISO and IEC in English only. CSA Group will publish the French version when it bec

25、omes available from ISO and IEC.This International Standard was reviewed by the TCIT under the jurisdiction of the Strategic Steering Committee on Information Technology and deemed acceptable for use in Canada. From time to time, ISO/IEC may publish addenda, corrigenda, etc. The TCIT will review the

26、se documents for approval and publication. For a listing, refer to the Current Standards Activities page at standardsactivities.csa.ca. This Standard has been formally approved, without modification, by the Technical Committee and has been approved as a National Standard of Canada by the Standards C

27、ouncil of Canada. 2013 CSA GroupAll rights reserved. No part of this publication may be reproduced in any form whatsoever without the prior permission of thepublisher. ISO/IEC material is reprinted with permission. Where the words “this International Standard” appear in the text, they should be inte

28、rpreted as “this National Standard of Canada”.Inquiries regarding this National Standard of Canada should be addressed toCSA Group5060 Spectrum Way, Suite 100, Mississauga, Ontario, Canada L4W 5N61-800-463-6727 416-747-4000http:/csa.caTo purchase standards and related publications, visit our Online

29、Store at shop.csa.ca or call toll-free 1-800-463-6727 or 416-747-4044.This Standard is subject to periodic review, and suggestions for its improvement will be referred to the appropriate committee. To submit a proposal for change, please send the following information to inquiriescsagroup.org and in

30、clude “Proposal for change” in the subject line:(a) Standard designation (number);(b) relevant clause, table, and/or figure number;(c) wording of the proposed change; and(d) rationale for the change.Reference numberISO/IEC 9899:2011(E)ISO/IEC 2011INTERNATIONAL STANDARD ISO/IEC9899Third edition2011-1

31、2-15Information technology Programming languages C Technologies de linformation Langages de programmation C ISO/IEC 9899:2011(E) COPYRIGHT PROTECTED DOCUMENT ISO/IEC 2011 All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized in any form or by any

32、means, electronic or mechanical, including photocopying and microfilm, without permission in writing from either ISO at the address below or ISOs member body in the country of the requester. ISO copyright office Case postale 56 CH-1211 Geneva 20 Tel. + 41 22 749 01 11 Fax + 41 22 749 09 47 E-mail co

33、pyrightiso.org Web www.iso.org ii ISO/IEC 2011 All rights reservedCAN/CSA-ISO/IEC 9899:13 ISO/IEC 2011 All rights reserved ISO/IEC 9899:2011 (E)ContentsForeword . xiiiIntroduction xvii1. Scope . 12. Normative references . 23. Terms, definitions, and symbols . 34. Conformance 85. Environment 105.1 Co

34、nceptual models . 105.1.1 Translation environment 105.1.2 Execution environments 125.2 Environmental considerations . 225.2.1 Character sets 225.2.2 Character display semantics 245.2.3 Signals and interrupts . 255.2.4 Environmental limits . 256. Language 356.1 Notation 356.2 Concepts . 356.2.1 Scope

35、s of identifiers . 356.2.2 Linkages of identifiers . 366.2.3 Name spaces of identifiers . 376.2.4 Storage durations of objects 386.2.5 Types . 396.2.6 Representations of types 446.2.7 Compatible type and composite type . 476.2.8 Alignment of objects . 486.3 Conversions 506.3.1 Arithmetic operands .

36、506.3.2 Other operands . 546.4 Lexical elements 576.4.1 Keywords 586.4.2 Identifiers 596.4.3 Universal character names . 616.4.4 Constants 626.4.5 String literals 706.4.6 Punctuators . 726.4.7 Header names 736.4.8 Preprocessing numbers 746.4.9 Comments . 75Contents iiiCAN/CSA-ISO/IEC 9899:13ISO/IEC

37、9899:2011 (E) ISO/IEC 2011 All rights reserved6.5 Expressions 766.5.1 Primary expressions . 786.5.2 Postfix operators . 796.5.3 Unary operators . 886.5.4 Cast operators 916.5.5 Multiplicative operators 926.5.6 Additive operators 926.5.7 Bitwise shift operators . 946.5.8 Relational operators 956.5.9

38、Equality operators 966.5.10 Bitwise AND operator . 976.5.11 Bitwise exclusive OR operator . 986.5.12 Bitwise inclusive OR operator 986.5.13 Logical AND operator . 996.5.14 Logical OR operator . 996.5.15 Conditional operator .1006.5.16 Assignment operators .1016.5.17 Comma operator .1056.6 Constant e

39、xpressions .1066.7 Declarations 1086.7.1 Storage-class specifiers 1096.7.2 Type specifiers 1116.7.3 Type qualifiers 1216.7.4 Function specifiers 1256.7.5 Alignment specifier 1276.7.6 Declarators .1286.7.7 Type names .1366.7.8 Type definitions .1376.7.9 Initialization 1396.7.10 Static assertions .145

40、6.8 Statements and blocks 1466.8.1 Labeled statements 1466.8.2 Compound statement .1476.8.3 Expression and null statements .1476.8.4 Selection statements .1486.8.5 Iteration statements 1506.8.6 Jump statements .1516.9 External definitions .1556.9.1 Function definitions 1566.9.2 External object defin

41、itions .1586.10 Preprocessing directives .1606.10.1 Conditional inclusion .1626.10.2 Source file inclusion .1646.10.3 Macro replacement 166iv ContentsCAN/CSA-ISO/IEC 9899:13 ISO/IEC 2011 All rights reserved ISO/IEC 9899:2011 (E)6.10.4 Line control .1736.10.5 Error directive 1746.10.6 Pragma directiv

42、e .1746.10.7 Null directive 1756.10.8 Predefined macro names 1756.10.9 Pragma operator .1786.11 Future language directions 1796.11.1 Floating types 1796.11.2 Linkages of identifiers .1796.11.3 External names .1796.11.4 Character escape sequences 1796.11.5 Storage-class specifiers 1796.11.6 Function

43、declarators .1796.11.7 Function definitions 1796.11.8 Pragma directives 1796.11.9 Predefined macro names 1797. Library .1807.1 Introduction 1807.1.1 Definitions of terms 1807.1.2 Standard headers .1817.1.3 Reserved identifiers 1827.1.4 Use of library functions 1837.2 Diagnostics 1867.2.1 Program dia

44、gnostics .1867.3 Complex arithmetic 1887.3.1 Introduction .1887.3.2 Conventions .1897.3.3 Branch cuts .1897.3.4 The CX_LIMITED_RANGE pragma .1897.3.5 Trigonometric functions 1907.3.6 Hyperbolic functions .1927.3.7 Exponential and logarithmic functions 1947.3.8 Power and absolute-value functions .195

45、7.3.9 Manipulation functions 1967.4 Character handling 2007.4.1 Character classification functions 2007.4.2 Character case mapping functions 2037.5 Errors .2057.6 Floating-point environment .2067.6.1 The FENV_ACCESS pragma 2087.6.2 Floating-point exceptions .2097.6.3 Rounding 2127.6.4 Environment 21

46、37.7 Characteristics of floating types .216Contents vCAN/CSA-ISO/IEC 9899:13ISO/IEC 9899:2011 (E) ISO/IEC 2011 All rights reserved7.8 Format conversion of integer types 2177.8.1 Macros for format specifiers 2177.8.2 Functions for greatest-width integer types .2187.9 Alternative spellings .2217.10 Si

47、zes of integer types 2227.11 Localization 2237.11.1 Locale control 2247.11.2 Numeric formatting convention inquiry 2257.12 Mathematics .2317.12.1 Treatment of error conditions 2337.12.2 The FP_CONTRACT pragma 2357.12.3 Classification macros .2357.12.4 Trigonometric functions 2387.12.5 Hyperbolic fun

48、ctions .2407.12.6 Exponential and logarithmic functions 2427.12.7 Power and absolute-value functions .2477.12.8 Error and gamma functions .2497.12.9 Nearest integer functions 2517.12.10 Remainder functions .2547.12.11 Manipulation functions 2557.12.12 Maximum, minimum, and positive difference functi

49、ons .2577.12.13 Floating multiply-add .2587.12.14 Comparison macros 2597.13 Nonlocal jumps 2627.13.1 Save calling environment .2627.13.2 Restore calling environment 2637.14 Signal handling .2657.14.1 Specify signal handling 2667.14.2 Send signal .2677.15 Alignment .2687.16 Variable arguments .2697.16.1 Variable argument list access macros .2697.17 Ato

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 标准规范 > 国际标准 > 其他

copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
备案/许可证编号:苏ICP备17064731号-1