📄 c90标准(tc1).htm
字号:
<BLOCKQUOTE>The initial value of the object, including unnamed members, is that of the expression.</BLOCKQUOTE><I>Page 80</I><BR><B>In subclause 6.6.6.4, lines 30-32, replace:</B><BLOCKQUOTE>If the expression has a type different from that of the function in which it appears, it is converted as if it were assigned to an object of that type.</BLOCKQUOTE><B>with:</B><BLOCKQUOTE>If the expression has a type different from the return type of the function in which it appears, the value is converted as if by assignment toan object having the return type of the function.<SUP>*</SUP><BR>[Footnote *: The <TT><B>return</B></TT> statement is not an assignment. The overlap restriction in subclause 6.3.16.1 does not apply to the case of function return.]</BLOCKQUOTE><B>Add to subclause 6.6.6.4:</B><BR><B>Example</B><BLOCKQUOTE>In:</BLOCKQUOTE><PRE> <TT><B>struct s {double i;} f(void);<BR> union {struct {int f1; struct s f2;} u1; struct {struct s f3; int f4;} u2; } g; struct s f(void) { return g.u1.f2; } /* </B></TT><I>...</I><TT> <B>*/ g.u2.f3 = f();</B></TT></PRE><BLOCKQUOTE>the behavior is defined.</BLOCKQUOTE><I>Page 84</I><BR><B>Add to subclause 6.7.2, a second Example:</B><BLOCKQUOTE>If at the end of the translation unit containing</BLOCKQUOTE><BLOCKQUOTE><TT><B> int i[]; </B></TT></BLOCKQUOTE><BLOCKQUOTE>the array <TT><B>i</B></TT> still has incomplete type, the array is assumed to have one element. This element is initialized to zero on program startup.</BLOCKQUOTE><I>Page 86</I><BR><B>Add to subclause 6.8, line 5, (<TT>Description</TT>): </B><BLOCKQUOTE>A new-line character ends the preprocessing directive even if it occurs within what would otherwise be an invocation of a function-like macro.</BLOCKQUOTE><B>Add to subclause 6.8, (<TT>Constraints</TT>):</B><BLOCKQUOTE>In the definition of an object-like macro, if the first character of a replacement list is not a character required by subclause 5.2.1, then there shall be white-space separation between the identifier and the replacement list.<SUP>*</SUP><BR>[Footnote *: This allows an implementation to choose to interpret the directive:</BLOCKQUOTE><BLOCKQUOTE><TT><B> #define THIS$AND$THAT(a, b) ((a) + (b))</B></TT></BLOCKQUOTE><BLOCKQUOTE>as defining a function-like macro <TT><B>THIS$AND$THAT</B></TT>, rather than an object-like macro <TT><B>THIS</B></TT>. Whichever choice it makes, it must also issue a diagnostic.]</BLOCKQUOTE><I>Page 90</I><BR><B>Add to subclause 6.8.3.3:</B><BR><B>Example</B><BLOCKQUOTE><TT><B>#define hash_hash # ## #<BR>#define mkstr(a) # a<BR>#define in_between(a) mkstr(a)<BR>#define join(c, d) in_between(c hash_hash d)char p[] = join(x, y); /*</B></TT> <I>equivalent to char p[] = "x ## y";</I> <TT><B>*/</B></TT></BLOCKQUOTE><BLOCKQUOTE>The expansion produces, at various stages:</BLOCKQUOTE><BLOCKQUOTE><TT><B>join(x, y)<BR><BR>in_between(x hash_hash y)<BR><BR>in_between(x ## y)<BR><BR>mkstr(x ## y)<BR><BR>"x ## y"</B></TT></BLOCKQUOTE><BLOCKQUOTE>In other words, expanding <TT><B>hash_hash</B></TT> produces a new token, consisting of two adjacent sharp signs, but this new token is not the catenation operator.</BLOCKQUOTE><I>Page 96</I><BR><B>Add to subclause 7.1.2, (before <I>Forward references</I>):</B><BLOCKQUOTE>Any definition of an object-like macro described in this clause shall expand to code that is fully protected by parentheses where necessary, so that it g</BLOCKQUOTE>roups in an arbitrary expression as if it were a single identifier.<B>In subclause 7.1.2, lines 32-33, change:</B><BLOCKQUOTE>However, if the identifier is declared or defined in more than one header,</BLOCKQUOTE><B>to:</B><BLOCKQUOTE>However, if an identifier is declared or defined in more than one header,</BLOCKQUOTE><I>Page 120</I><BR><B>In subclause 7.7, lines 14-16, change:</B><BLOCKQUOTE>and the following, each of which expands to a positive integral constant expression that is the signal number corresponding to the specified condition:</BLOCKQUOTE><B>to:</B><BLOCKQUOTE>and the following, which expand to positive integral constant expressions with distinct values that are the signal numbers, each corresponding to the specified condition:</BLOCKQUOTE><I>Page 132</I><BR><B>In subclause 7.9.6.1, lines 37-38, change:</B><BLOCKQUOTE>For <TT><B>o</B></TT> conversion, it increases the precision to force the first digit of the result to be a zero.</BLOCKQUOTE><B>to:</B><BLOCKQUOTE>For <TT><B>o</B></TT> conversion, it increases the precision, if and only if necessary, to force the first digit of the result to be a zero.</BLOCKQUOTE><I>Page 135</I><BR><B>In subclause 7.9.6.2, lines 31-33, change:</B><BLOCKQUOTE>An input item is defined as the longest matching sequence of input characters, unless that exceeds a specified field width, in which case it is the initial subsequence of that length in the sequence.</BLOCKQUOTE><B>to:</B><BLOCKQUOTE>An input item is defined as the longest sequence of input characters which does not exceed any specified field width and which is, or is a prefix of, a matching input sequence.</BLOCKQUOTE><I>Page 137</I><BR><B>In subclause 7.9.6.2, delete:</B><BLOCKQUOTE>If conversion terminates on a conflicting input character, the offending input character is left unread in the input stream.</BLOCKQUOTE><B>Add to subclause 7.9.6.2, line 4 (the</B> <TT><B>n</B></TT> <B>conversion specifier):</B><BLOCKQUOTE>No argument is converted, but one is consumed. If the conversion specification with this conversion specifier is not one of <TT><B>%n</B></TT>, <TT><B>%ln</B></TT>, or <TT><B>%hn</B></TT>, the behavior is undefined.</BLOCKQUOTE><B>Add to subclause 7.9.6.2:</B><BLOCKQUOTE>If conversion terminates on a conflicting input character, the offending input character is left unread in the input stream.<SUP>*</SUP><BR> [Footnote *: <TT><B>fscanf</B></TT> pushes back at most one input character onto the input stream. Therefore, some sequences that are acceptable to <TT><B>strtod</B></TT>, <TT><B>strtol</B></TT>, or <TT><B>strtoul</B></TT> are unacceptable to <TT><B>fscanf</B></TT>.]</BLOCKQUOTE><I>Page 138</I><BR><B>Add to subclause 7.9.6.2, another Example:</B><BR><BLOCKQUOTE>In:</BLOCKQUOTE><BLOCKQUOTE><TT><B>#include <stdio.h><BR>/*</B></TT><I> ...</I> <TT><B>*/<BR>int d1, d2, n1, n2, i;<BR>i = sscanf("123", "%d%n%n%d", &d1, &n1,&n2, &d2);</B></TT></BLOCKQUOTE><BLOCKQUOTE>the value <B><TT>123</TT></B> is assigned to <TT><B>d1</B></TT> and the value 3 to <TT><B>n1</B></TT>. Because <TT><B>%n</B></TT> can never get an input failure the value of 3 is also assigned to <TT><B>n2</B></TT>. The value of <TT><B>d2</B></TT> is not affected. The value 3 is assigned to <TT><B>i</B></TT>.</BLOCKQUOTE><I>Page 145</I><BR><B>In subclause 7.9.9.2, lines 39-40, change:</B><BLOCKQUOTE>a value returned by an earlier call to the <TT><B>ftell</B></TT> function</BLOCKQUOTE><B>to:</B><BLOCKQUOTE>a value returned by an earlier successful call to the <TT><B>ftell</B></TT> function</BLOCKQUOTE><I>Page 146</I><BR><B>In subclause 7.9.9.3, lines 10-11, change:</B><BLOCKQUOTE>a value obtained from an earlier call to the <TT><B>fgetpos</B></TT> function</BLOCKQUOTE><B>to:</B><BLOCKQUOTE>a value obtained from an earlier successful call to the <TT><B>fgetpos</B></TT> function</BLOCKQUOTE><BR><I>Page 162</I><BR><B>Add to subclause 7.11.1:</B><BLOCKQUOTE>Where an argument declared as <TT><B>size_t n</B></TT> specifies the length of the array for a function, <TT><B>n</B></TT> can have the value zero on a call to that function. Unless explicitly stated otherwise in the description of a particular function in this subclause, pointer arguments on such a call must still have valid values, as described in subclause 7.1.7. On such a call, a function that locates a character finds no occurrence, a function that compares two character sequences returns zero, and a function that copies characters copies zero characters.</BLOCKQUOTE><I>Page 172</I><BR><B>In subclause 7.12.2.3, line 16, change:</B><BLOCKQUOTE><PRE><TT><B>if (mktime(&time_str) == -1)</B></TT></PRE></BLOCKQUOTE><B>to:</B><PRE> <TT><B>if (mktime(&ime_str) == (time_t)-1)</B></TT></PRE><I>Page 200</I><BR><B>Add to subclause G.2:</B><BR> <BLOCKQUOTE>A program contains no function called <TT><B>main</B></TT> (5.1.2.2.1).</BLOCKQUOTE><I>Page 201</I><BR><B>Add to subclause G.2:</B><BR> <BLOCKQUOTE>A storage-class specifier or type qualifier modifies the keyword <TT><B>void</B></TT> as a function parameter type list (6.5.4.3).</BLOCKQUOTE><BR><B>Add to subclause G.2:</B> <BLOCKQUOTE>An array subscript is out of range, even if an object is apparently accessible with the given subscript (as in the lvalue expression <TT><B>a[1][7]</B></TT> given the declaration <TT><B>int a[4][5]</B></TT>) (6.3.6).</BLOCKQUOTE><I>Page 202</I><BR><B>Add to subclause G.2:</B><BLOCKQUOTE>A fully expanded macro replacement list contains a function-like macro name as its last preprocessing token (6.8.3).</BLOCKQUOTE><I>Page 203</I><BR><B>Add to subclause G.2:</B><BLOCKQUOTE> A call to a library function exceeds an <B>environmental limit</B> (7.9.2, 7.9.3, 7.9.4.4, 7.9.6.1, 7.10.2.1).</BLOCKQUOTE><I>Page 217</I><BR><B>In the index, change:</B><BR><BLOCKQUOTE><TT><B>static</B></TT> storage-class specifier, 3.1.2.2, 6.1.2.4, <B>6.5.1</B>, 6.7</BLOCKQUOTE><B>to:</B><BLOCKQUOTE><TT><B>static</B></TT> storage-class specifier, 6.1.2.2, 6.1.2.4, <B>6.5.1</B>, 6.7</BLOCKQUOTE></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -