Стандарт языка Си С99 TC (1113411), страница 15
Текст из файла (страница 15)
*/}Each time the function is called, it will print to the standard output stream:myfuncForward references: function definitions (6.9.1).61) Since the name _ _func_ _ is reserved for any use by the implementation (7.1.3), if any otheridentifier is explicitly declared using the name _ _func_ _, the behavior is undefined.52Language§6.4.2.2WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC36.4.3 Universal character namesSyntax1universal-character-name:\u hex-quad\U hex-quad hex-quadhex-quad:hexadecimal-digit hexadecimal-digithexadecimal-digit hexadecimal-digitConstraints2A universal character name shall not specify a character whose short identifier is less than00A0 other than 0024 ($), 0040 (@), or 0060 (‘), nor one in the range D800 throughDFFF inclusive.62)Description3Universal character names may be used in identifiers, character constants, and stringliterals to designate characters that are not in the basic character set.Semantics4The universal character name \Unnnnnnnn designates the character whose eight-digitshort identifier (as specified by ISO/IEC 10646) is nnnnnnnn.63) Similarly, the universalcharacter name \unnnn designates the character whose four-digit short identifier is nnnn(and whose eight-digit short identifier is 0000nnnn).62) The disallowed characters are the characters in the basic character set and the code positions reservedby ISO/IEC 10646 for control characters, the character DELETE, and the S-zone (reserved for use byUTF−16).63) Short identifiers for characters were first specified in ISO/IEC 10646−1/AMD9:1997.§6.4.3Language53ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N12566.4.4 ConstantsSyntax1constant:integer-constantfloating-constantenumeration-constantcharacter-constantConstraints2Each constant shall have a type and the value of a constant shall be in the range ofrepresentable values for its type.Semantics3Each constant has a type, determined by its form and value, as detailed later.6.4.4.1 Integer constantsSyntax1integer-constant:decimal-constant integer-suffixoptoctal-constant integer-suffixopthexadecimal-constant integer-suffixoptdecimal-constant:nonzero-digitdecimal-constant digitoctal-constant:0octal-constant octal-digithexadecimal-constant:hexadecimal-prefix hexadecimal-digithexadecimal-constant hexadecimal-digithexadecimal-prefix: one of0x 0X54nonzero-digit: one of1 2 3 45678octal-digit: one of0 1 2 34567Language9§6.4.4.1WG14/N1256Committee Draft — Septermber 7, 2007hexadecimal-digit:0 1 2a b cA B Cone of3 4d eD E5fF678ISO/IEC 9899:TC39integer-suffix:unsigned-suffix long-suffixoptunsigned-suffix long-long-suffixlong-suffix unsigned-suffixoptlong-long-suffix unsigned-suffixoptunsigned-suffix: one ofu Ulong-suffix: one ofl Llong-long-suffix: one ofll LLDescription2An integer constant begins with a digit, but has no period or exponent part.
It may have aprefix that specifies its base and a suffix that specifies its type.3A decimal constant begins with a nonzero digit and consists of a sequence of decimaldigits. An octal constant consists of the prefix 0 optionally followed by a sequence of thedigits 0 through 7 only. A hexadecimal constant consists of the prefix 0x or 0X followedby a sequence of the decimal digits and the letters a (or A) through f (or F) with values10 through 15 respectively.Semantics4The value of a decimal constant is computed base 10; that of an octal constant, base 8;that of a hexadecimal constant, base 16. The lexically first digit is the most significant.5The type of an integer constant is the first of the corresponding list in which its value canbe represented.§6.4.4.1Language55ISO/IEC 9899:TC3Suffix6Committee Draft — Septermber 7, 2007Decimal ConstantWG14/N1256Octal or HexadecimalConstantnoneintlong intlong long intintunsigned intlong intunsigned long intlong long intunsigned long long intu or Uunsigned intunsigned long intunsigned long long intunsigned intunsigned long intunsigned long long intl or Llong intlong long intlong intunsigned long intlong long intunsigned long long intBoth u or Uand l or Lunsigned long intunsigned long long intunsigned long intunsigned long long intll or LLlong long intlong long intunsigned long long intBoth u or Uand ll or LLunsigned long long intunsigned long long intIf an integer constant cannot be represented by any type in its list, it may have anextended integer type, if the extended integer type can represent its value.
If all of thetypes in the list for the constant are signed, the extended integer type shall be signed. Ifall of the types in the list for the constant are unsigned, the extended integer type shall beunsigned. If the list contains both signed and unsigned types, the extended integer typemay be signed or unsigned. If an integer constant cannot be represented by any type inits list and has no extended integer type, then the integer constant has no type.56Language§6.4.4.1WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC36.4.4.2 Floating constantsSyntax1floating-constant:decimal-floating-constanthexadecimal-floating-constantdecimal-floating-constant:fractional-constant exponent-partopt floating-suffixoptdigit-sequence exponent-part floating-suffixopthexadecimal-floating-constant:hexadecimal-prefix hexadecimal-fractional-constantbinary-exponent-part floating-suffixopthexadecimal-prefix hexadecimal-digit-sequencebinary-exponent-part floating-suffixoptfractional-constant:digit-sequenceopt .
digit-sequencedigit-sequence .exponent-part:e signopt digit-sequenceE signopt digit-sequencesign: one of+ digit-sequence:digitdigit-sequence digithexadecimal-fractional-constant:hexadecimal-digit-sequenceopt .hexadecimal-digit-sequencehexadecimal-digit-sequence .binary-exponent-part:p signopt digit-sequenceP signopt digit-sequencehexadecimal-digit-sequence:hexadecimal-digithexadecimal-digit-sequence hexadecimal-digitfloating-suffix: one off l F L§6.4.4.2Language57ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N1256Description2A floating constant has a significand part that may be followed by an exponent part and asuffix that specifies its type.
The components of the significand part may include a digitsequence representing the whole-number part, followed by a period (.), followed by adigit sequence representing the fraction part. The components of the exponent part are ane, E, p, or P followed by an exponent consisting of an optionally signed digit sequence.Either the whole-number part or the fraction part has to be present; for decimal floatingconstants, either the period or the exponent part has to be present.Semantics3The significand part is interpreted as a (decimal or hexadecimal) rational number; thedigit sequence in the exponent part is interpreted as a decimal integer.
For decimalfloating constants, the exponent indicates the power of 10 by which the significand part isto be scaled. For hexadecimal floating constants, the exponent indicates the power of 2by which the significand part is to be scaled.
For decimal floating constants, and also forhexadecimal floating constants when FLT_RADIX is not a power of 2, the result is eitherthe nearest representable value, or the larger or smaller representable value immediatelyadjacent to the nearest representable value, chosen in an implementation-defined manner.For hexadecimal floating constants when FLT_RADIX is a power of 2, the result iscorrectly rounded.4An unsuffixed floating constant has type double.
If suffixed by the letter f or F, it hastype float. If suffixed by the letter l or L, it has type long double.5Floating constants are converted to internal format as if at translation-time. Theconversion of a floating constant shall not raise an exceptional condition or a floatingpoint exception at execution time.Recommended practice6The implementation should produce a diagnostic message if a hexadecimal constantcannot be represented exactly in its evaluation format; the implementation should thenproceed with the translation of the program.7The translation-time conversion of floating constants should match the execution-timeconversion of character strings by library functions, such as strtod, given matchinginputs suitable for both conversions, the same result format, and default execution-timerounding.64)64) The specification for the library functions recommends more accurate conversion than required forfloating constants (see 7.20.1.3).58Language§6.4.4.2WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC36.4.4.3 Enumeration constantsSyntax1enumeration-constant:identifierSemantics2An identifier declared as an enumeration constant has type int.Forward references: enumeration specifiers (6.7.2.2).6.4.4.4 Character constantsSyntax1character-constant:' c-char-sequence 'L' c-char-sequence 'c-char-sequence:c-charc-char-sequence c-charc-char:any member of the source character set exceptthe single-quote ', backslash \, or new-line characterescape-sequenceescape-sequence:simple-escape-sequenceoctal-escape-sequencehexadecimal-escape-sequenceuniversal-character-namesimple-escape-sequence: one of\' \" \? \\\a \b \f \n \r\t\voctal-escape-sequence:\ octal-digit\ octal-digit octal-digit\ octal-digit octal-digit octal-digithexadecimal-escape-sequence:\x hexadecimal-digithexadecimal-escape-sequence hexadecimal-digit§6.4.4.4Language59ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N1256Description2An integer character constant is a sequence of one or more multibyte characters enclosedin single-quotes, as in 'x'.