Minor Changes to C9_xxxx _S_e_p_t_e_m_b_e_r _2_6_, _1_9_9_7 _D_o_c_u_m_e_n_t _N_o_. _W_G_1_4_/_N_7_6_2 _(_J_1_1_/_9_7_-_1_2_6_) Douglas A. Gwyn US Army Research Laboratory Adelphi, MD _A_B_S_T_R_A_C_T While looking things up in C9_x Draft 10, I found several places where small improvements were needed. Some of these could be considered editorial, but others are clearly substantive. Most of the ideas for substantive changes arose in the course of editorial work on already-approved proposals. Because we are trying to complete the C9_x document as soon as possible, I propose only changes that can be quickly and easily made as part of the ongoing editing process. My intention is that the Menlo Park agenda include a session wherein each item would be briefly presented, questions would be answered, and a quick yes/no vote would be taken for each proposed change. (If any item were to require extended debate, then I would simply withdraw that proposal.) 1. kkkkeeeeyyyywwwwoooorrrrddddssss ccccaaaannnnnnnnooootttt bbbbeeee iiiiddddeeeennnnttttiiiiffffiiiieeeerrrrssss 1.1 _t_h_e__p_r_o_b_l_e_m There is a CCCCoooonnnnssssttttrrrraaaaiiiinnnntttt in 6666....1111....2222 IIIIddddeeeennnnttttiiiiffffiiiieeeerrrrssss that says: In translation phases 7 and 8, an identifier shall not consist of the same sequence of characters as a keyword. This injunction is already given in the preceding 6666....1111....1111 KKKKeeeeyyyywwwwoooorrrrddddssss, SSSSeeeemmmmaaaannnnttttiiiiccccssss, and I'm not sure that there is a reliable way to diagnose all violations. 1.2 _m_y__p_r_o_p_o_s_a_l I suggest any of three alternatives: 1.2.1 Change the CCCCoooonnnnssssttttrrrraaaaiiiinnnnttttssss given in 6666....1111....2222 IIIIddddeeeennnnttttiiiiffffiiiieeeerrrrssss to a footnote. 1 Document No. WG14/N762 (J11/97-126)Minor Changes to C9_x September 26, 1997 1.2.2 Move the CCCCoooonnnnssssttttrrrraaaaiiiinnnnttttssss given in 6666....1111....2222 IIIIddddeeeennnnttttiiiiffffiiiieeeerrrrssss to the DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn section of the same subclause. 1.2.3 Delete the CCCCoooonnnnssssttttrrrraaaaiiiinnnnttttssss given in 6666....1111....2222 IIIIddddeeeennnnttttiiiiffffiiiieeeerrrrssss. 2. ppppuuuurrrreeee bbbbiiiinnnnaaaarrrryyyy nnnnuuuummmmeeeerrrraaaattttiiiioooonnnn ssssyyyysssstttteeeemmmm 2.1 _t_h_e__p_r_o_b_l_e_m The requirement that integer types be represented using a ``pure binary numeration system'' has important ramifications; however, the explanation of this phrase is delegated to a footnote, leading many readers of the Standard to believe that it is not normative. 2.2 _m_y__p_r_o_p_o_s_a_l Move the text of Footnote 25 from 6666....1111....2222....5555 TTTTyyyyppppeeeessss to clause 3333 DDDDeeeeffffiiiinnnniiiittttiiiioooonnnnssss aaaannnndddd ccccoooonnnnvvvveeeennnnttttiiiioooonnnnssss (new subclause 3333....11116666++++ PPPPuuuurrrreeee bbbbiiiinnnnaaaarrrryyyy nnnnuuuummmmeeeerrrraaaattttiiiioooonnnn ssssyyyysssstttteeeemmmm), and delete the footnote reference mark ``25''. 3. ssssttttrrrriiiinnnngggg lllliiiitttteeeerrrraaaallll ccccoooonnnnffffuuuussssiiiioooonnnn 3.1 _t_h_e__p_r_o_b_l_e_m In the course of figuring out whether the requirement in 6666....5555....7777 IIIInnnniiiittttiiiiaaaalllliiiizzzzaaaattttiiiioooonnnn, CCCCoooonnnnssssttttrrrraaaaiiiinnnnttttssss that each expression in an initializer list for certain objects be a constant expression properly allows for the use of string literals to initialize character arrays, I discovered some sloppiness in the use of the term ``string literal''. (Incidentally, the answer to the above question is ``yes'', although it depends on some accidents working out right.) 6666....1111....4444 SSSSttttrrrriiiinnnngggg lllliiiitttteeeerrrraaaallllssss says that ``A character string literal is a sequence of zero or more multibyte characters enclosed in double-quotes'', and similarly for wide string literals. However, for the logic of 6666....5555....7777 IIIInnnniiiittttiiiiaaaalllliiiizzzzaaaattttiiiioooonnnn to work out right, ``string literal'' really needs to designate the resulting object after translation phase 7. The EEEExxxxaaaammmmpppplllleeee in 6666....1111....4444 SSSSttttrrrriiiinnnngggg lllliiiitttteeeerrrraaaallllssss is also phrased in such a way as to indicate this. (The EEEExxxxaaaammmmpppplllleeee is incorrect in stating that there are two characters contained in the resulting string literal; there are actually _t_h_r_e_e, including the terminating null byte.) 2 September 26, 1997 Minor Changes to C9_xDocument No. WG14/N762 (J11/97-126) 3.2 _d_i_s_c_u_s_s_i_o_n It is tricky to fix any of this without breaking things. Therefore I propose a very slight tweak to the existing wording. 3.3 _m_y__p_r_o_p_o_s_a_l In 6666....1111....4444 SSSSttttrrrriiiinnnngggg lllliiiitttteeeerrrraaaallllssss, DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn, change the first sentence from A character string literal is a sequence of zero or more multibyte characters enclosed in double-quotes, as in "xyz". to A character string literal is designated by a sequence of zero or more multibyte characters enclosed in double-quotes, as in "xyz". In 6666....1111....4444 SSSSttttrrrriiiinnnngggg lllliiiitttteeeerrrraaaallllssss, EEEExxxxaaaammmmpppplllleeeessss, change produces a single character string literal containing the two characters whose values are '\x12' and '3', to produces a single character string literal containing the three characters whose values are '\x12', '3', and 0, 4. ssssttttrrrraaaannnnggggeeee cccchhhhaaaarrrraaaacccctttteeeerrrrssss iiiinnnn eeeexxxxaaaammmmpppplllleeee 4.1 _t_h_e__p_r_o_b_l_e_m One of the EEEExxxxaaaammmmpppplllleeeessss at the end of 6666....1111....7777, which doesn't belong in this subclause anyway, uses characters that are not in the basic source character set, rendering the example not strictly conforming. 4.2 _m_y__p_r_o_p_o_s_a_l In 6666....1111....7777 HHHHeeeeaaaaddddeeeerrrr nnnnaaaammmmeeeessss, EEEExxxxaaaammmmpppplllleeeessss, delete the two lines: #define const.member@$ and {#}{define} {const}{.}{member}{@}{$} 5. eeeerrrrrrrroooorrrrssss iiiinnnn eeeexxxxaaaammmmpppplllleeee ccccoooommmmmmmmeeeennnnttttssss 3 Document No. WG14/N762 (J11/97-126)Minor Changes to C9_x September 26, 1997 5.1 _t_h_e__p_r_o_b_l_e_m A few typographic errors crept into the EEEExxxxaaaammmmpppplllleeeessss in 6666....1111....9999 CCCCoooommmmmmmmeeeennnnttttssss. Also, the four-character constant is unnecessary and perhaps even unwise, since it is not strictly conforming code, and the four-character string literal illustrates the same point. 5.2 _m_y__p_r_o_p_o_s_a_l Replace 6666....1111....9999 CCCCoooommmmmmmmeeeennnnttttssss, EEEExxxxaaaammmmpppplllleeeessss content with the following: "a//b" // _f_o_u_r-_c_h_a_r_a_c_t_e_r _s_t_r_i_n_g _l_i_t_e_r_a_l #include "//e" // _u_n_d_e_f_i_n_e_d _b_e_h_a_v_i_o_r // */ // _c_o_m_m_e_n_t, _n_o_t _s_y_n_t_a_x _e_r_r_o_r _f = _g/**//_h; // _e_q_u_i_v_a_l_e_n_t _t_o _f = _g / _h; //\ _i(); // _p_a_r_t _o_f _t_w_o-_l_i_n_e _c_o_m_m_e_n_t /\ / _j(); // _p_a_r_t _o_f _t_w_o-_l_i_n_e _c_o_m_m_e_n_t #_d_e_f_i_n_e _g_l_u_e(_x,_y) _x##_y _g_l_u_e(/,/) _k(); // _s_y_n_t_a_x _e_r_r_o_r, _n_o_t _c_o_m_m_e_n_t /*//*/ _l(); // _e_q_u_i_v_a_l_e_n_t _t_o _l(); _m = _n//**/_o + _p; // _e_q_u_i_v_a_l_e_n_t _t_o _m = _n + _p; _6. ppppooooiiiinnnntttteeeerrrr <<<<-------->>>> iiiinnnntttteeeeggggeeeerrrr ccccoooonnnnvvvveeeerrrrssssiiiioooonnnn 6.1 _t_h_e__p_r_o_b_l_e_m Apparently DR #57 said that there doesn't have to exist an integer type suitable for holding any object pointer, but the wording in the C9x draft about this, which has not changed since C89, can easily be read as stating the opposite. A second problem is that the current wording requires the implementation to define the meaning for every conversion of an arbitrary integer value to a pointer, which seems to impose an unnecessarily heavy burden on some implementations. 6.2 _m_y__i_n_t_e_n_t_i_o_n I agree that it is best not to require that implementations provide such a type; also that it can be useful for implementations to support such conversions. Because the current wording does not guarantee that the type must exist, and the ``requirement'' occurs in a SSSSeeeemmmmaaaannnnttttiiiiccccssss section, I 4 September 26, 1997 Minor Changes to C9_xDocument No. WG14/N762 (J11/97-126) believe that the following change would not affect any implementation or program, but it would more clearly indicate the nature of such a facility. (It could make implementation conformance easier in some cases.) 6.3 _m_y__p_r_o_p_o_s_a_l Remove the following words from 6666....3333....4444 CCCCaaaasssstttt ooooppppeeeerrrraaaattttoooorrrrssss, SSSSeeeemmmmaaaannnnttttiiiiccccssss: A pointer may be converted to an integer type. The size of integer required and the result are implementation-defined. If the space provided is not long enough, the behavior is undefined. An arbitrary integer may be converted to a pointer. The result is implementation-defined.58 along with Footnote 58. In IIII....5555 CCCCoooommmmmmmmoooonnnn eeeexxxxtttteeeennnnssssiiiioooonnnnssss, add a new subclause IIII....5555....6666++++ CCCCoooonnnnvvvveeeerrrrssssiiiioooonnnn bbbbeeeettttwwwweeeeeeeennnn ppppooooiiiinnnntttteeeerrrrssss aaaannnndddd iiiinnnntttteeeeggggeeeerrrrssss: A pointer may be converted to some integer type, and some integers may be converted to pointers. Details of these conversions are implementation-defined. (6.3.4) 7. ttttrrrraaaaiiiilllliiiinnnngggg ccccoooommmmmmmmaaaa oooonnnn eeeennnnuuuummmmeeeerrrraaaattttoooorrrr lllliiiisssstttt 7.1 _t_h_e__p_r_o_b_l_e_m Many people, including Ken Thompson, responded unfavorably to C89's requirement that a trailing comma after an enumerator list must be diagnosed, contrary to previous widespread existing practice. This requirement is inconsistent with C89's treatment of trailing comma after an initializer list (it's optional there), and it complicates programs that generate C source code. 7.2 _m_y__p_r_o_p_o_s_a_l In 6666....5555....2222....2222 EEEEnnnnuuuummmmeeeerrrraaaattttiiiioooonnnn ssssppppeeeecccciiiiffffiiiieeeerrrrssss, SSSSyyyynnnnttttaaaaxxxx, add another derivation rule to the grammar for _e_n_u_m-_s_p_e_c_i_f_i_e_r: enum identifieropt { enumerator-list , } Also make the corresponding change in BBBB....2222....2222 DDDDeeeeccccllllaaaarrrraaaattttiiiioooonnnnssss. 5 Document No. WG14/N762 (J11/97-126)Minor Changes to C9_x September 26, 1997 8. eeeerrrrrrrroooonnnneeeeoooouuuussss ffffoooooooottttnnnnooootttteeee 88882222 8.1 _t_h_e__p_r_o_b_l_e_m Footnote 82 erroneously says that only through the use of typedefs can array or function type specifications include any type qualifiers. 8.2 _m_y__o_p_i_n_i_o_n I think this footnote was trying to be helpful, but incorrect footnotes are not helpful. 8.3 _m_y__p_r_o_p_o_s_a_l In 6666....5555....3333 TTTTyyyyppppeeee qqqquuuuaaaalllliiiiffffiiiieeeerrrrssss, delete Footnote 82 and the reference to it. 9. ttttyyyyppppeeeeddddeeeeffffssss ddddoooonnnn''''tttt ddddeeeeffffiiiinnnneeee 9.1 _t_h_e__p_r_o_b_l_e_m Some people have found the terminology of 6666....5555....6666 TTTTyyyyppppeeee ddddeeeeffffiiiinnnniiiittttiiiioooonnnnssss misleading. 9.2 _m_y__p_r_o_p_o_s_a_l Change the name to 6666....5555....6666 TTTTyyyyppppeeeeddddeeeeffffssss, and in the first sentence of SSSSeeeemmmmaaaannnnttttiiiiccccssss change each declarator defines to each declarator declares 10. ____PPPPrrrraaaaggggmmmmaaaa mmmmiiiissssssssiiiinnnngggg ffffrrrroooommmm ggggrrrraaaammmmmmmmaaaarrrr 10.1 _t_h_e__p_r_o_b_l_e_m There ought to be a derivation rule involving the new _Pragma operator. 10.2 _m_y__p_r_o_p_o_s_a_l In 6666....8888 PPPPrrrreeeepppprrrroooocccceeeessssssssiiiinnnngggg ddddiiiirrrreeeeccccttttiiiivvvveeeessss, SSSSyyyynnnnttttaaaaxxxx, add another derivation rule for _c_o_n_t_r_o_l-_l_i_n_e: _Pragma ( _s_t_r_i_n_g-_l_i_t_e_r_a_l ) 6 September 26, 1997 Minor Changes to C9_xDocument No. WG14/N762 (J11/97-126) _1_1. mmmmiiiissssppppllllaaaacccceeeedddd mmmmaaaaccccrrrroooo----rrrreeeeppppllllaaaacccceeeemmmmeeeennnntttt ccccoooonnnnssssttttrrrraaaaiiiinnnntttt 11.1 _t_h_e__p_r_o_b_l_e_m The last CCCCoooonnnnssssttttrrrraaaaiiiinnnntttt in 6666....8888....1111 CCCCoooonnnnddddiiiittttiiiioooonnnnaaaallll iiiinnnncccclllluuuussssiiiioooonnnn has nothing to do with conditional inclusion. 11.2 _m_y__p_r_o_p_o_s_a_l Move the last paragraph from 6666....8888....1111 CCCCoooonnnnddddiiiittttiiiioooonnnnaaaallll iiiinnnncccclllluuuussssiiiioooonnnn, CCCCoooonnnnssssttttrrrraaaaiiiinnnnttttssss: Each preprocessing token that remains after all macro replacements have occurred shall be in the lexical form of a token. to a new CCCCoooonnnnssssttttrrrraaaaiiiinnnnttttssss section at the beginning of 6666....8888....3333....4444 RRRReeeessssccccaaaannnnnnnniiiinnnngggg aaaannnndddd ffffuuuurrrrtttthhhheeeerrrr rrrreeeeppppllllaaaacccceeeemmmmeeeennnntttt, and follow this with the (previously implicit) section heading SSSSeeeemmmmaaaannnnttttiiiiccccssss. 12. rrrreeeeppppllllaaaacccceeeemmmmeeeennnntttt ooooffff oooobbbbjjjjeeeecccctttt----lllliiiikkkkeeee mmmmaaaaccccrrrroooo iiiiddddeeeennnnttttiiiiffffiiiieeeerrrr 12.1 _t_h_e__p_r_o_b_l_e_m The macro replacement semantics incorrectly include among identifiers that are replaced by macro expansion those that are used as macro names in various preprocessing directives. 12.2 _m_y__p_r_o_p_o_s_a_l In 6666....8888....3333 MMMMaaaaccccrrrroooo rrrreeeeppppllllaaaacccceeeemmmmeeeennnntttt, SSSSeeeemmmmaaaannnnttttiiiiccccssss, change defines an object-like macro that causes each subsequent instance of the macro name106 to defines an object-like macro that causes each subsequent instance of the macro name106, except for the identifier in another #define, #undef, #ifdef, or #ifndef directive or as the operand of a defined operator, 13. ttttyyyyppppeeee qqqquuuuaaaalllliiiiffffiiiieeeerrrrssss iiiinnnn ssssttttaaaannnnddddaaaarrrrdddd hhhheeeeaaaaddddeeeerrrrssss 13.1 _t_h_e__p_r_o_b_l_e_m An implementation may declare typedef names as qualified types in the standard headers. This can cause unpleasant surprises. 7 Document No. WG14/N762 (J11/97-126)Minor Changes to C9_x September 26, 1997 13.2 _n_o_t_e This is _n_o_t just nit-picking; I have heard that at least one implementation already includes volatile _i_n _i_t_s _d_e_c_l_a_r_a_t_i_o_n _o_f _s_i_g__a_t_o_m_i_c__t. 13.3 _m_y__p_r_o_p_o_s_a_l I actually have two alternative formulations, depending on whether there is a consensus that some standard typedef names (_e._g., sig_atomic_t) ought to be allowed to be declared as qualified types. 13.3.1 At the end of 7777....1111....2222 SSSSttttaaaannnnddddaaaarrrrdddd hhhheeeeaaaaddddeeeerrrrssss add a new paragraph: Declarations of types described in this clause shall not include type qualifiers. 13.3.2 At the end of 7777....1111....2222 SSSSttttaaaannnnddddaaaarrrrdddd hhhheeeeaaaaddddeeeerrrrssss add a new paragraph: Declarations of types described in this clause shall not include type qualifiers, unless explicitly stated otherwise. 13.3.2.1 If it is decided that a contrary type is sig_atomic_t, then also in 7777....11110000 SSSSiiiiggggnnnnaaaallll hhhhaaaannnnddddlllliiiinnnngggg cccchhhhaaaannnnggggeeee wwwwhhhhiiiicccchhhh iiiissss tttthhhheeee iiiinnnntttteeeeggggeeeerrrr ttttyyyyppppeeee ooooffff aaaannnn oooobbbbjjjjeeeecccctttt ttttoooo wwwwhhhhiiiicccchhhh iiiissss tttthhhheeee ((((ppppoooossssssssiiiibbbbllllyyyy vvvvoooollllaaaattttiiiilllleeee----qqqquuuuaaaalllliiiiffffiiiieeeedddd)))) iiiinnnntttteeeeggggeeeerrrr ttttyyyyppppeeee ooooffff aaaannnn oooobbbbjjjjeeeecccctttt 11114444.... mmmmaaaatttthhhh eeeerrrrrrrroooorrrr ccccoooonnnnddddiiiittttiiiioooonnnnssss mmmmiiiissssppppllllaaaacccceeeedddd 14.1 _t_h_e__p_r_o_b_l_e_m Subclause 7777....7777....3333 TTTTrrrreeeeaaaattttmmmmeeeennnntttt ooooffff eeeerrrrrrrroooorrrr ccccoooonnnnddddiiiittttiiiioooonnnnssss is embedded in the middle of functional descriptions, instead of being near the front of the subclause, which would be more in line with the general style of the Standard. 14.2 _m_y__p_r_o_p_o_s_a_l Move the entire subclause (including heading, with automatic renumbering) 7777....7777....3333 TTTTrrrreeeeaaaattttmmmmeeeennnntttt ooooffff eeeerrrrrrrroooorrrr ccccoooonnnnddddiiiittttiiiioooonnnnssss in front of 7777....7777....1111 TTTThhhheeee FP_CONTRACT pppprrrraaaaggggmmmmaaaa.... 8 September 26, 1997 Minor Changes to C9_xDocument No. WG14/N762 (J11/97-126) 11115555.... mmmmiiiissssssssiiiinnnngggg wwwwoooorrrrddddssss ffffoooorrrr llllggggaaaammmmmmmmaaaa 15.1 _t_h_e__p_r_o_b_l_e_m The lgamma RRRReeeettttuuuurrrrnnnnssss specification is inaccurate. 15.2 _m_y__p_r_o_p_o_s_a_l In 7777....7777....8888....4444 TTTThhhheeee lgamma ffffuuuunnnnccccttttiiiioooonnnn,,,, RRRReeeettttuuuurrrrnnnnssss, cccchhhhaaaannnnggggeeee ````````ggggaaaammmmmmmmaaaa'''''''' ttttoooo ````````ggggaaaammmmmmmmaaaa ooooffff xxxx''''''''.... 11116666.... rrrraaaacccceeee ccccoooonnnnddddiiiittttiiiioooonnnn iiiinnnn ssssiiiiggggnnnnaaaallll hhhhaaaannnnddddlllleeeerrrr 16.1 _t_h_e__p_r_o_b_l_e_m The C89 condition that a signal handler upon entry can have SIG_DFL established for the signal (which forces an unsafe timing window for asynchronous signals) is a hold-over from pre-POSIX days that encourages programmers to use less- standard signal mechanisms. (I argued for this specification originally, on the grounds of backward compatibility.) A second, related problem is that too little is said about the implementation-defined blocking, making it difficult to write useful portable programs using signal. 16.2 _m_y__i_n_t_e_n_t_i_o_n The C89 alternative, implementation-defined blocking of the signal, should now be required. Just enough additional requirements should be imposed to guarantee a reasonable way to safely write portable programs that catch asynchronous signals such as SIGINT. I believe my proposal for the latter is compatible with current implementations of signal blocking, but I would appreciate feedback on this matter. 16.3 _m_y__p_r_o_p_o_s_a_l I propose two independent changes that can be decided separately: 16.3.1 In 7777....11110000....1111....1111 TTTThhhheeee signal ffffuuuunnnnccccttttiiiioooonnnn,,,, DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn, sssseeeeccccoooonnnndddd ppppaaaarrrraaaaggggrrrraaaapppphhhh,,,, cccchhhhaaaannnnggggeeee WWWWhhhheeeennnn aaaa ssssiiiiggggnnnnaaaallll ooooccccccccuuuurrrrssss,,,, iiiiffff ffffuuuunnnncccc ppppooooiiiinnnnttttssss ttttoooo aaaa ffffuuuunnnnccccttttiiiioooonnnn,,,, ffffiiiirrrrsssstttt tttthhhheeee eeeeqqqquuuuiiiivvvvaaaalllleeeennnntttt ooooffff ssssiiiiggggnnnnaaaallll((((ssssiiiigggg,,,, SSSSIIIIGGGG____DDDDFFFFLLLL))));;;; iiiissss eeeexxxxeeeeccccuuuutttteeeedddd oooorrrr aaaannnn iiiimmmmpppplllleeeemmmmeeeennnnttttaaaattttiiiioooonnnn----ddddeeeeffffiiiinnnneeeedddd bbbblllloooocccckkkkiiiinnnngggg ooooffff tttthhhheeee ssssiiiiggggnnnnaaaallll iiiissss ppppeeeerrrrffffoooorrrrmmmmeeeedddd.... ((((IIIIffff tttthhhheeee vvvvaaaalllluuuueeee ooooffff ssssiiiigggg iiiissss SSSSIIIIGGGGIIIILLLLLLLL,,,, wwwwhhhheeeetttthhhheeeerrrr tttthhhheeee rrrreeeesssseeeetttt ttttoooo SSSSIIIIGGGG____DDDDFFFFLLLL ooooccccccccuuuurrrrssss iiiissss iiiimmmmpppplllleeeemmmmeeeennnnttttaaaattttiiiioooonnnn---- ddddeeeeffffiiiinnnneeeedddd....)))) 9 Document No. WG14/N762 (J11/97-126)Minor Changes to C9_x September 26, 1997 ttttoooo WWWWhhhheeeennnn aaaa ssssiiiiggggnnnnaaaallll ooooccccccccuuuurrrrssss,,,, iiiiffff ffffuuuunnnncccc ppppooooiiiinnnnttttssss ttttoooo aaaa ffffuuuunnnnccccttttiiiioooonnnn,,,, ffffiiiirrrrsssstttt aaaannnn iiiimmmmpppplllleeeemmmmeeeennnnttttaaaattttiiiioooonnnn----ddddeeeeffffiiiinnnneeeedddd bbbblllloooocccckkkkiiiinnnngggg ooooffff tttthhhheeee ssssiiiiggggnnnnaaaallll iiiissss ppppeeeerrrrffffoooorrrrmmmmeeeedddd.... 11116666....3333....2222 After the third paragraph in 7777....11110000....1111....1111 TTTThhhheeee signal ffffuuuunnnnccccttttiiiioooonnnn,,,, DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn, aaaadddddddd aaaa nnnneeeewwww ppppaaaarrrraaaaggggrrrraaaapppphhhh:::: WWWWhhhhiiiilllleeee aaaa ssssiiiiggggnnnnaaaallll iiiissss bbbblllloooocccckkkkeeeedddd,,,, aaaa ccccaaaallllllll ttttoooo tttthhhheeee ssssiiiiggggnnnnaaaallll ffffuuuunnnnccccttttiiiioooonnnn wwwwiiiitttthhhh ssssiiiigggg eeeeqqqquuuuaaaallll ttttoooo tttthhhhaaaatttt ssssiiiiggggnnnnaaaallll nnnnuuuummmmbbbbeeeerrrr sssshhhhaaaallllllll ccccaaaauuuusssseeee tttthhhheeee ssssiiiiggggnnnnaaaallll ttttoooo bbbbeeee uuuunnnnbbbblllloooocccckkkkeeeedddd.... AAAAllllssssoooo,,,, aaaappppppppeeeennnndddd ttttoooo tttthhhheeee ffffoooouuuurrrrtttthhhh ppppaaaarrrraaaaggggrrrraaaapppphhhh ((((ccccoooonnnncccceeeerrrrnnnniiiinnnngggg pppprrrrooooggggrrrraaaammmm ssssttttaaaarrrrttttuuuupppp)))) iiiinnnn 7777....11110000....1111....1111 TTTThhhheeee ssssiiiiggggnnnnaaaallll ffffuuuunnnnccccttttiiiioooonnnn,,,, DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn: SSSSoooommmmeeee ssssiiiiggggnnnnaaaallllssss mmmmaaaayyyy bbbbeeee bbbblllloooocccckkkkeeeedddd uuuuppppoooonnnn pppprrrrooooggggrrrraaaammmm ssssttttaaaarrrrttttuuuupppp.... 11117777.... mmmmoooorrrreeee ssssiiiiggggnnnnaaaallll rrrreeeettttuuuurrrrnnnnssss uuuunnnnddddeeeeffffiiiinnnneeeedddd 17.1 _t_h_e__p_r_o_b_l_e_m Returning from a signal handler for SIGILL or SIGSEGV ought to explicitly cause undefined behavior (because that's what happens in actuality). 17.2 _m_y__p_r_o_p_o_s_a_l In 7777....11110000....1111....1111 TTTThhhheeee signal ffffuuuunnnnccccttttiiiioooonnnn,,,, DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn, sssseeeeccccoooonnnndddd ppppaaaarrrraaaaggggrrrraaaapppphhhh,,,, cccchhhhaaaannnnggggeeee aaaannnndddd tttthhhheeee vvvvaaaalllluuuueeee ooooffff ssssiiiigggg wwwwaaaassss SSSSIIIIGGGGFFFFPPPPEEEE ttttoooo aaaannnndddd tttthhhheeee vvvvaaaalllluuuueeee ooooffff ssssiiiigggg wwwwaaaassss SSSSIIIIGGGGFFFFPPPPEEEE,,,, SSSSIIIIGGGGIIIILLLLLLLL,,,, SSSSIIIIGGGGSSSSEEEEGGGGVVVV,,,, 11118888.... ffffuuuunnnnccccttttiiiioooonnnnssss iiiinnnn ssssiiiiggggnnnnaaaallll hhhhaaaannnnddddlllleeeerrrr 18.1 _t_h_e__p_r_o_b_l_e_m The words ``the signal function itself'' might be confusing, since ``itself'' more properly refers to the signal handler. 18.2 _m_y__s_o_l_u_t_i_o_n In 7777....11110000....1111....1111 TTTThhhheeee signal ffffuuuunnnnccccttttiiiioooonnnn,,,, DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn, tttthhhhiiiirrrrdddd ppppaaaarrrraaaaggggrrrraaaapppphhhh,,,, cccchhhhaaaannnnggggeeee ooootttthhhheeeerrrr tttthhhhaaaannnn tttthhhheeee ssssiiiiggggnnnnaaaallll ffffuuuunnnnccccttttiiiioooonnnn iiiittttsssseeeellllffff ttttoooo ooootttthhhheeeerrrr tttthhhhaaaannnn tttthhhheeee ssssiiiiggggnnnnaaaallll ffffuuuunnnnccccttttiiiioooonnnn 10 September 26, 1997 Minor Changes to C9_xDocument No. WG14/N762 (J11/97-126) 11119999.... ooooppppeeeennnniiiinnnngggg tttteeeexxxxtttt ffffiiiilllleeee iiiinnnn uuuuppppddddaaaatttteeee mmmmooooddddeeee 19.1 _t_h_e__p_r_o_b_l_e_m The draft says, Opening (or creating) a text file with update mode may instead open (or create) a binary stream in some implementations. This doesn't seem like a specification so much as a warning. Since an attempt to open a file inappropriately is allowed to fail, it is much better in such a situation for fopen to report failure than to secretly shift the mode of the stream (which could invalidate further processing). 19.2 _m_y__p_r_o_p_o_s_a_l In 7777....11112222....5555....3333 TTTThhhheeee fopen ffffuuuunnnnccccttttiiiioooonnnn,,,, DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn, ddddeeeelllleeeetttteeee tttthhhhaaaatttt sssseeeennnntttteeeennnncccceeee:::: OOOOppppeeeennnniiiinnnngggg ((((oooorrrr ccccrrrreeeeaaaattttiiiinnnngggg)))) aaaa tttteeeexxxxtttt ffffiiiilllleeee wwwwiiiitttthhhh uuuuppppddddaaaatttteeee mmmmooooddddeeee mmmmaaaayyyy iiiinnnnsssstttteeeeaaaadddd ooooppppeeeennnn ((((oooorrrr ccccrrrreeeeaaaatttteeee)))) aaaa bbbbiiiinnnnaaaarrrryyyy ssssttttrrrreeeeaaaammmm iiiinnnn ssssoooommmmeeee iiiimmmmpppplllleeeemmmmeeeennnnttttaaaattttiiiioooonnnnssss.... 22220000.... ccccoooommmmmmmmoooonnnn ffffpppprrrriiiinnnnttttffff eeeexxxxtttteeeennnnssssiiiioooonnnn 20.1 _t_h_e__p_r_o_b_l_e_m There is no good reason to disallow %lf in fprintf format strings. It makes sense, improves compatibility with fscanf format strings, and is commonly implemented as a conforming extension. Also, %d _v_s. %hd _i_s _s_u_p_p_o_r_t_e_d, _w_h_i_c_h _m_a_k_e_s _n_o _m_o_r_e _o_r _l_e_s_s _s_e_n_s_e _t_h_a_n %_l_f _v_s. %f. _2_0._2 _c_o_m_m_e_n_t I suspect that one reason this was left out was the difficulty in fitting it into the wording pattern of the existing text. 20.3 _m_y__p_r_o_p_o_s_a_l In 7777....11112222....6666....1111 TTTThhhheeee fprintf ffffuuuunnnnccccttttiiiioooonnnn,,,, DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn, bbbbeeeeffffoooorrrreeee oooorrrr aaaannnn ooooppppttttiiiioooonnnnaaaallll LLLL ssssppppeeeecccciiiiffffyyyyiiiinnnngggg iiiinnnnsssseeeerrrrtttt tttthhhheeee ffffoooolllllllloooowwwwiiiinnnngggg:::: aaaannnn ooooppppttttiiiioooonnnnaaaallll llll ffffoooolllllllloooowwwweeeedddd bbbbyyyy aaaannnn aaaa,,,, AAAA,,,, eeee,,,, EEEE,,,, ffff,,,, FFFF,,,, gggg,,,, oooorrrr GGGG ccccoooonnnnvvvveeeerrrrssssiiiioooonnnn ssssppppeeeecccciiiiffffiiiieeeerrrr ((((tttthhhheeee llll hhhhaaaassss nnnnoooo eeeeffffffffeeeecccctttt))));;;; IIIInnnn 7777....11118888....1111....1111 TTTThhhheeee ffffwwwwpppprrrriiiinnnnttttffff ffffuuuunnnnccccttttiiiioooonnnn,,,, DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn, bbbbeeeeffffoooorrrreeee oooorrrr aaaannnn ooooppppttttiiiioooonnnnaaaallll LLLL ssssppppeeeecccciiiiffffyyyyiiiinnnngggg iiiinnnnsssseeeerrrrtttt tttthhhheeee ffffoooolllllllloooowwwwiiiinnnngggg:::: aaaannnn ooooppppttttiiiioooonnnnaaaallll llll ffffoooolllllllloooowwwweeeedddd bbbbyyyy aaaannnn aaaa,,,, AAAA,,,, eeee,,,, EEEE,,,, ffff,,,, FFFF,,,, gggg,,,, oooorrrr GGGG 11 Document No. WG14/N762 (J11/97-126)Minor Changes to C9_x September 26, 1997 ccccoooonnnnvvvveeeerrrrssssiiiioooonnnn ssssppppeeeecccciiiiffffiiiieeeerrrr ((((tttthhhheeee llll hhhhaaaassss nnnnoooo eeeeffffffffeeeecccctttt))));;;; 22221111.... eeeerrrrrrrroooorrrrssss iiiinnnn ffffssssccccaaaannnnffff ssssppppeeeecccc 21.1 _t_h_e__p_r_o_b_l_e_m fscanf's %i, %d, and %n are said to have arguments that are merely pointers to integer; that should be _s_i_g_n_e_d integer. Also, the undefined term ``valid'' is used, whereas the fprintf _s_p_e_c_i_f_i_c_a_t_i_o_n _c_o_n_t_a_i_n_s _b_e_t_t_e_r _w_o_r_d_i_n_g _t_h_a_t _c_o_u_l_d _b_e _a_d_o_p_t_e_d _f_o_r _f_s_c_a_n_f. There is also a misleading ``which'' where the restrictive ``that'' is needed. 21.2 _m_y__p_r_o_p_o_s_a_l The following three items can be decided separately. 21.2.1 In 7777....11112222....6666....2222 TTTThhhheeee fscanf ffffuuuunnnnccccttttiiiioooonnnn,,,, DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn, iiiinnnn tttthhhheeee ppppaaaarrrraaaaggggrrrraaaapppphhhh bbbbeeeeggggiiiinnnnnnnniiiinnnngggg ````````AAAAnnnn iiiinnnnppppuuuutttt iiiitttteeeemmmm iiiissss rrrreeeeaaaadddd ffffrrrroooommmm tttthhhheeee ssssttttrrrreeeeaaaammmm,,,,'''''''' cccchhhhaaaannnnggggeeee tttthhhheeee lllloooonnnnggggeeeesssstttt sssseeeeqqqquuuueeeennnncccceeee ooooffff iiiinnnnppppuuuutttt cccchhhhaaaarrrraaaacccctttteeeerrrrssss wwwwhhhhiiiicccchhhh ddddooooeeeessss nnnnooootttt eeeexxxxcccceeeeeeeedddd ttttoooo tttthhhheeee lllloooonnnnggggeeeesssstttt sssseeeeqqqquuuueeeennnncccceeee ooooffff iiiinnnnppppuuuutttt cccchhhhaaaarrrraaaacccctttteeeerrrrssss tttthhhhaaaatttt ddddooooeeeessss nnnnooootttt eeeexxxxcccceeeeeeeedddd IIIInnnn 7777....11118888....2222....2222 TTTThhhheeee ffffwwwwssssccccaaaannnnffff ffffuuuunnnnccccttttiiiioooonnnn,,,, DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn, iiiinnnn tttthhhheeee ppppaaaarrrraaaaggggrrrraaaapppphhhh bbbbeeeeggggiiiinnnnnnnniiiinnnngggg ````````AAAAnnnn iiiinnnnppppuuuutttt iiiitttteeeemmmm iiiissss rrrreeeeaaaadddd ffffrrrroooommmm tttthhhheeee ssssttttrrrreeeeaaaammmm,,,,'''''''' cccchhhhaaaannnnggggeeee tttthhhheeee lllloooonnnnggggeeeesssstttt sssseeeeqqqquuuueeeennnncccceeee ooooffff iiiinnnnppppuuuutttt wwwwiiiiddddeeee cccchhhhaaaarrrraaaacccctttteeeerrrrssss wwwwhhhhiiiicccchhhh ddddooooeeeessss nnnnooootttt eeeexxxxcccceeeeeeeedddd ttttoooo tttthhhheeee lllloooonnnnggggeeeesssstttt sssseeeeqqqquuuueeeennnncccceeee ooooffff iiiinnnnppppuuuutttt wwwwiiiiddddeeee cccchhhhaaaarrrraaaacccctttteeeerrrrssss tttthhhhaaaatttt ddddooooeeeessss nnnnooootttt eeeexxxxcccceeeeeeeedddd 22221111....2222....2222 In 7777....11112222....6666....2222 TTTThhhheeee fscanf ffffuuuunnnnccccttttiiiioooonnnn,,,, DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn, cccchhhhaaaannnnggggeeee TTTThhhheeee ffffoooolllllllloooowwwwiiiinnnngggg ccccoooonnnnvvvveeeerrrrssssiiiioooonnnn ssssppppeeeecccciiiiffffiiiieeeerrrrssss aaaarrrreeee vvvvaaaalllliiiidddd:::: ttttoooo TTTThhhheeee ccccoooonnnnvvvveeeerrrrssssiiiioooonnnn ssssppppeeeecccciiiiffffiiiieeeerrrrssss aaaannnndddd tttthhhheeeeiiiirrrr mmmmeeeeaaaannnniiiinnnnggggssss aaaarrrreeee:::: IIIInnnn 7777....11118888....2222....2222 TTTThhhheeee ffffwwwwssssccccaaaannnnffff ffffuuuunnnnccccttttiiiioooonnnn,,,, DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn, cccchhhhaaaannnnggggeeee TTTThhhheeee ffffoooolllllllloooowwwwiiiinnnngggg ccccoooonnnnvvvveeeerrrrssssiiiioooonnnn ssssppppeeeecccciiiiffffiiiieeeerrrrssss aaaarrrreeee vvvvaaaalllliiiidddd:::: ttttoooo TTTThhhheeee ccccoooonnnnvvvveeeerrrrssssiiiioooonnnn ssssppppeeeecccciiiiffffiiiieeeerrrrssss aaaannnndddd tttthhhheeeeiiiirrrr mmmmeeeeaaaannnniiiinnnnggggssss aaaarrrreeee:::: 12 September 26, 1997 Minor Changes to C9_xDocument No. WG14/N762 (J11/97-126) 22221111....2222....3333 In 7777....11112222....6666....2222 TTTThhhheeee fscanf ffffuuuunnnnccccttttiiiioooonnnn,,,, DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn, uuuunnnnddddeeeerrrr eeeeaaaacccchhhh ooooffff tttthhhheeee ccccoooonnnnvvvveeeerrrrssssiiiioooonnnn ssssppppeeeecccciiiiffffiiiieeeerrrrssss dddd,,,, iiii,,,, aaaannnndddd nnnn,,,, cccchhhhaaaannnnggggeeee sssshhhhaaaallllllll bbbbeeee aaaa ppppooooiiiinnnntttteeeerrrr ttttoooo iiiinnnntttteeeeggggeeeerrrr ttttoooo sssshhhhaaaallllllll bbbbeeee aaaa ppppooooiiiinnnntttteeeerrrr ttttoooo ssssiiiiggggnnnneeeedddd iiiinnnntttteeeeggggeeeerrrr IIIInnnn 7777....11118888....2222....2222 TTTThhhheeee ffffwwwwssssccccaaaannnnffff ffffuuuunnnnccccttttiiiioooonnnn,,,, DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn, uuuunnnnddddeeeerrrr eeeeaaaacccchhhh ooooffff tttthhhheeee ccccoooonnnnvvvveeeerrrrssssiiiioooonnnn ssssppppeeeecccciiiiffffiiiieeeerrrrssss dddd,,,, iiii,,,, aaaannnndddd nnnn,,,, cccchhhhaaaannnnggggeeee sssshhhhaaaallllllll bbbbeeee aaaa ppppooooiiiinnnntttteeeerrrr ttttoooo iiiinnnntttteeeeggggeeeerrrr ttttoooo sssshhhhaaaallllllll bbbbeeee aaaa ppppooooiiiinnnntttteeeerrrr ttttoooo ssssiiiiggggnnnneeeedddd iiiinnnntttteeeeggggeeeerrrr 22222222.... nnnnuuuummmmeeeerrrriiiicccc ccccoooonnnnvvvveeeerrrrssssiiiioooonnnn ffffoooorrrr cccchhhhaaaarrrr ttttyyyyppppeeee 22.1 _t_h_e__p_r_o_b_l_e_m The lack of a numeric conversion specification in fscanf for char data analogous to %hd for short, %d for int, %ld for long, and %lld for long long became quite apparent while I was attempting to update the specification (Document WG14/N761). Such a format conversion could be quite useful in reading Boolean values, for example. There are also a couple of errors associated with the addition of wording for ll. 22.2 _d_i_s_c_u_s_s_i_o_n The only reason I can see for this omission is historical inertia. To maintain maximum parallelism between fprintf and fscanf, we ought to add the facility to both families rather than just to fscanf. I intentionally don't try to cover wchar_t data, because that's not one of the basic standard integer types. 22.3 _m_y__p_r_o_p_o_s_a_l I suggest two alternatives for how to spell the conversion modifier, hh or H. Here I show just the hh alternative (which is the one I prefer); it would be easy enough to edit this to use another spelling. 22.3.1 In 7777....11112222....6666....1111 TTTThhhheeee fprintf ffffuuuunnnnccccttttiiiioooonnnn,,,, DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn, cccchhhhaaaannnnggggeeee ---- AAAAnnnn ooooppppttttiiiioooonnnnaaaallll hhhh ssssppppeeeecccciiiiffffyyyyiiiinnnngggg tttthhhhaaaatttt aaaa ffffoooolllllllloooowwwwiiiinnnngggg dddd,,,, ttttoooo 13 Document No. WG14/N762 (J11/97-126)Minor Changes to C9_x September 26, 1997 ---- AAAAnnnn ooooppppttttiiiioooonnnnaaaallll hhhhhhhh ssssppppeeeecccciiiiffffyyyyiiiinnnngggg tttthhhhaaaatttt aaaa ffffoooolllllllloooowwwwiiiinnnngggg dddd,,,, iiii,,,, oooo,,,, uuuu,,,, xxxx,,,, oooorrrr XXXX ccccoooonnnnvvvveeeerrrrssssiiiioooonnnn ssssppppeeeecccciiiiffffiiiieeeerrrr aaaapppppppplllliiiieeeessss ttttoooo aaaa ssssiiiiggggnnnneeeedddd cccchhhhaaaarrrr oooorrrr uuuunnnnssssiiiiggggnnnneeeedddd cccchhhhaaaarrrr aaaarrrrgggguuuummmmeeeennnntttt ((((tttthhhheeee aaaarrrrgggguuuummmmeeeennnntttt wwwwiiiillllllll hhhhaaaavvvveeee bbbbeeeeeeeennnn pppprrrroooommmmooootttteeeedddd aaaaccccccccoooorrrrddddiiiinnnngggg ttttoooo tttthhhheeee iiiinnnntttteeeeggggrrrraaaallll pppprrrroooommmmoooottttiiiioooonnnnssss,,,, aaaannnndddd iiiittttssss vvvvaaaalllluuuueeee sssshhhhaaaallllllll bbbbeeee ccccoooonnnnvvvveeeerrrrtttteeeedddd ttttoooo ssssiiiiggggnnnneeeedddd cccchhhhaaaarrrr oooorrrr uuuunnnnssssiiiiggggnnnneeeedddd cccchhhhaaaarrrr bbbbeeeeffffoooorrrreeee pppprrrriiiinnnnttttiiiinnnngggg))));;;; aaaannnn ooooppppttttiiiioooonnnnaaaallll hhhh ssssppppeeeecccciiiiffffyyyyiiiinnnngggg tttthhhhaaaatttt aaaa ffffoooolllllllloooowwwwiiiinnnngggg dddd,,,, IIIInnnn tttthhhheeee ssssaaaammmmeeee ppppaaaarrrraaaaggggrrrraaaapppphhhh,,,, cccchhhhaaaannnnggggeeee IIIIffff aaaannnn hhhh,,,, llll,,,, oooorrrr LLLL aaaappppppppeeeeaaaarrrrssss wwwwiiiitttthhhh aaaannnnyyyy ooootttthhhheeeerrrr ttttoooo IIIIffff aaaannnn hhhhhhhh,,,, hhhh,,,, llll,,,, llllllll,,,, oooorrrr LLLL aaaappppppppeeeeaaaarrrrssss wwwwiiiitttthhhh aaaannnnyyyy ooootttthhhheeeerrrr IIIInnnn 7777....11112222....6666....2222 TTTThhhheeee ffffssssccccaaaannnnffff ffffuuuunnnnccccttttiiiioooonnnn,,,, DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn, cccchhhhaaaannnnggggeeee ---- AAAAnnnn ooooppppttttiiiioooonnnnaaaallll hhhh,,,, llll ((((eeeellllllll)))),,,, oooorrrr llllllll ((((eeeellllllll----eeeellllllll)))),,,, oooorrrr LLLL ttttoooo ---- AAAAnnnn ooooppppttttiiiioooonnnnaaaallll hhhhhhhh,,,, hhhh,,,, llll ((((eeeellllllll)))),,,, llllllll ((((eeeellllllll----eeeellllllll)))),,,, oooorrrr LLLL IIIInnnn tttthhhheeee ssssaaaammmmeeee ppppaaaarrrraaaaggggrrrraaaapppphhhh,,,, cccchhhhaaaannnnggggeeee dddd,,,, iiii,,,, aaaannnndddd nnnn sssshhhhaaaallllllll bbbbeeee pppprrrreeeecccceeeeddddeeeedddd bbbbyyyy hhhh iiiiffff tttthhhheeee ccccoooorrrrrrrreeeessssppppoooonnnnddddiiiinnnngggg aaaarrrrgggguuuummmmeeeennnntttt iiiissss aaaa ppppooooiiiinnnntttteeeerrrr ttttoooo sssshhhhoooorrrrtttt iiiinnnntttt rrrraaaatttthhhheeeerrrr tttthhhhaaaannnn aaaa ppppooooiiiinnnntttteeeerrrr ttttoooo iiiinnnntttt,,,, ttttoooo dddd,,,, iiii,,,, aaaannnndddd nnnn sssshhhhaaaallllllll bbbbeeee pppprrrreeeecccceeeeddddeeeedddd bbbbyyyy hhhhhhhh iiiiffff tttthhhheeee ccccoooorrrrrrrreeeessssppppoooonnnnddddiiiinnnngggg aaaarrrrgggguuuummmmeeeennnntttt iiiissss aaaa ppppooooiiiinnnntttteeeerrrr ttttoooo cccchhhhaaaarrrr rrrraaaatttthhhheeeerrrr tttthhhhaaaannnn aaaa ppppooooiiiinnnntttteeeerrrr ttttoooo iiiinnnntttt,,,, bbbbyyyy hhhh iiiiffff iiiitttt iiiissss aaaa ppppooooiiiinnnntttteeeerrrr ttttoooo sssshhhhoooorrrrtttt iiiinnnntttt,,,, IIIInnnn tttthhhheeee ssssaaaammmmeeee ppppaaaarrrraaaaggggrrrraaaapppphhhh,,,, cccchhhhaaaannnnggggeeee oooo,,,, uuuu,,,, aaaannnndddd xxxx sssshhhhaaaallllllll bbbbeeee pppprrrreeeecccceeeeddddeeeedddd bbbbyyyy hhhh iiiiffff tttthhhheeee ccccoooorrrrrrrreeeessssppppoooonnnnddddiiiinnnngggg aaaarrrrgggguuuummmmeeeennnntttt iiiissss aaaa ppppooooiiiinnnntttteeeerrrr ttttoooo uuuunnnnssssiiiiggggnnnneeeedddd sssshhhhoooorrrrtttt iiiinnnntttt rrrraaaatttthhhheeeerrrr tttthhhhaaaannnn aaaa ppppooooiiiinnnntttteeeerrrr ttttoooo uuuunnnnssssiiiiggggnnnneeeedddd iiiinnnntttt,,,, ttttoooo oooo,,,, uuuu,,,, aaaannnndddd xxxx sssshhhhaaaallllllll bbbbeeee pppprrrreeeecccceeeeddddeeeedddd bbbbyyyy hhhhhhhh iiiiffff tttthhhheeee ccccoooorrrrrrrreeeessssppppoooonnnnddddiiiinnnngggg aaaarrrrgggguuuummmmeeeennnntttt iiiissss aaaa ppppooooiiiinnnntttteeeerrrr ttttoooo uuuunnnnssssiiiiggggnnnneeeedddd cccchhhhaaaarrrr rrrraaaatttthhhheeeerrrr tttthhhhaaaannnn aaaa ppppooooiiiinnnntttteeeerrrr ttttoooo uuuunnnnssssiiiiggggnnnneeeedddd iiiinnnntttt,,,, bbbbyyyy hhhh iiiiffff iiiitttt iiiissss aaaa ppppooooiiiinnnntttteeeerrrr ttttoooo uuuunnnnssssiiiiggggnnnneeeedddd sssshhhhoooorrrrtttt iiiinnnntttt,,,, IIIInnnn tttthhhheeee ssssaaaammmmeeee ppppaaaarrrraaaaggggrrrraaaapppphhhh,,,, cccchhhhaaaannnnggggeeee IIIIffff aaaannnn hhhh,,,, llll,,,, oooorrrr LLLL aaaappppppppeeeeaaaarrrrssss wwwwiiiitttthhhh aaaannnnyyyy ooootttthhhheeeerrrr ttttoooo IIIIffff aaaannnn hhhhhhhh,,,, hhhh,,,, llll,,,, llllllll,,,, oooorrrr LLLL aaaappppppppeeeeaaaarrrrssss wwwwiiiitttthhhh aaaannnnyyyy ooootttthhhheeeerrrr IIIInnnn 7777....11118888....2222....1111 TTTThhhheeee ffffwwwwpppprrrriiiinnnnttttffff ffffuuuunnnnccccttttiiiioooonnnn,,,, DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn, cccchhhhaaaannnnggggeeee ---- aaaannnn ooooppppttttiiiioooonnnnaaaallll hhhh ssssppppeeeecccciiiiffffyyyyiiiinnnngggg tttthhhhaaaatttt aaaa ffffoooolllllllloooowwwwiiiinnnngggg dddd,,,, ttttoooo 14 September 26, 1997 Minor Changes to C9_xDocument No. WG14/N762 (J11/97-126) ---- aaaannnn ooooppppttttiiiioooonnnnaaaallll hhhhhhhh ssssppppeeeecccciiiiffffyyyyiiiinnnngggg tttthhhhaaaatttt aaaa ffffoooolllllllloooowwwwiiiinnnngggg dddd,,,, iiii,,,, oooo,,,, uuuu,,,, xxxx,,,, oooorrrr XXXX ccccoooonnnnvvvveeeerrrrssssiiiioooonnnn ssssppppeeeecccciiiiffffiiiieeeerrrr aaaapppppppplllliiiieeeessss ttttoooo aaaa ssssiiiiggggnnnneeeedddd cccchhhhaaaarrrr oooorrrr uuuunnnnssssiiiiggggnnnneeeedddd cccchhhhaaaarrrr aaaarrrrgggguuuummmmeeeennnntttt ((((tttthhhheeee aaaarrrrgggguuuummmmeeeennnntttt wwwwiiiillllllll hhhhaaaavvvveeee bbbbeeeeeeeennnn pppprrrroooommmmooootttteeeedddd aaaaccccccccoooorrrrddddiiiinnnngggg ttttoooo tttthhhheeee iiiinnnntttteeeeggggrrrraaaallll pppprrrroooommmmoooottttiiiioooonnnnssss,,,, aaaannnndddd iiiittttssss vvvvaaaalllluuuueeee sssshhhhaaaallllllll bbbbeeee ccccoooonnnnvvvveeeerrrrtttteeeedddd ttttoooo ssssiiiiggggnnnneeeedddd cccchhhhaaaarrrr oooorrrr uuuunnnnssssiiiiggggnnnneeeedddd cccchhhhaaaarrrr bbbbeeeeffffoooorrrreeee pppprrrriiiinnnnttttiiiinnnngggg))));;;; aaaannnn ooooppppttttiiiioooonnnnaaaallll hhhh ssssppppeeeecccciiiiffffyyyyiiiinnnngggg tttthhhhaaaatttt aaaa ffffoooolllllllloooowwwwiiiinnnngggg dddd,,,, IIIInnnn tttthhhheeee ssssaaaammmmeeee ppppaaaarrrraaaaggggrrrraaaapppphhhh,,,, cccchhhhaaaannnnggggeeee IIIIffff aaaannnn hhhh,,,, llll,,,, llllllll,,,, oooorrrr LLLL aaaappppppppeeeeaaaarrrrssss wwwwiiiitttthhhh aaaannnnyyyy ooootttthhhheeeerrrr ttttoooo IIIIffff aaaannnn hhhhhhhh,,,, hhhh,,,, llll,,,, llllllll,,,, oooorrrr LLLL aaaappppppppeeeeaaaarrrrssss wwwwiiiitttthhhh aaaannnnyyyy ooootttthhhheeeerrrr IIIInnnn 7777....11118888....2222....2222 TTTThhhheeee ffffwwwwssssccccaaaannnnffff ffffuuuunnnnccccttttiiiioooonnnn,,,, DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn, cccchhhhaaaannnnggggeeee ---- AAAAnnnn ooooppppttttiiiioooonnnnaaaallll hhhh,,,, llll ((((eeeellllllll)))),,,, llllllll ((((eeeellllllll----eeeellllllll)))),,,, oooorrrr LLLL ttttoooo ---- AAAAnnnn ooooppppttttiiiioooonnnnaaaallll hhhhhhhh,,,, hhhh,,,, llll ((((eeeellllllll)))),,,, llllllll ((((eeeellllllll----eeeellllllll)))),,,, oooorrrr LLLL IIIInnnn tttthhhheeee ssssaaaammmmeeee ppppaaaarrrraaaaggggrrrraaaapppphhhh,,,, cccchhhhaaaannnnggggeeee dddd,,,, iiii,,,, aaaannnndddd nnnn sssshhhhaaaallllllll bbbbeeee pppprrrreeeecccceeeeddddeeeedddd bbbbyyyy hhhh iiiiffff tttthhhheeee ccccoooorrrrrrrreeeessssppppoooonnnnddddiiiinnnngggg aaaarrrrgggguuuummmmeeeennnntttt iiiissss aaaa ppppooooiiiinnnntttteeeerrrr ttttoooo sssshhhhoooorrrrtttt iiiinnnntttt rrrraaaatttthhhheeeerrrr tttthhhhaaaannnn aaaa ppppooooiiiinnnntttteeeerrrr ttttoooo iiiinnnntttt,,,, ttttoooo dddd,,,, iiii,,,, aaaannnndddd nnnn sssshhhhaaaallllllll bbbbeeee pppprrrreeeecccceeeeddddeeeedddd bbbbyyyy hhhhhhhh iiiiffff tttthhhheeee ccccoooorrrrrrrreeeessssppppoooonnnnddddiiiinnnngggg aaaarrrrgggguuuummmmeeeennnntttt iiiissss aaaa ppppooooiiiinnnntttteeeerrrr ttttoooo cccchhhhaaaarrrr rrrraaaatttthhhheeeerrrr tttthhhhaaaannnn aaaa ppppooooiiiinnnntttteeeerrrr ttttoooo iiiinnnntttt,,,, bbbbyyyy hhhh iiiiffff iiiitttt iiiissss aaaa ppppooooiiiinnnntttteeeerrrr ttttoooo sssshhhhoooorrrrtttt iiiinnnntttt,,,, IIIInnnn tttthhhheeee ssssaaaammmmeeee ppppaaaarrrraaaaggggrrrraaaapppphhhh,,,, cccchhhhaaaannnnggggeeee oooo,,,, uuuu,,,, aaaannnndddd xxxx sssshhhhaaaallllllll bbbbeeee pppprrrreeeecccceeeeddddeeeedddd bbbbyyyy hhhh iiiiffff tttthhhheeee ccccoooorrrrrrrreeeessssppppoooonnnnddddiiiinnnngggg aaaarrrrgggguuuummmmeeeennnntttt iiiissss aaaa ppppooooiiiinnnntttteeeerrrr ttttoooo uuuunnnnssssiiiiggggnnnneeeedddd sssshhhhoooorrrrtttt iiiinnnntttt rrrraaaatttthhhheeeerrrr tttthhhhaaaannnn aaaa ppppooooiiiinnnntttteeeerrrr ttttoooo uuuunnnnssssiiiiggggnnnneeeedddd iiiinnnntttt,,,, ttttoooo oooo,,,, uuuu,,,, aaaannnndddd xxxx sssshhhhaaaallllllll bbbbeeee pppprrrreeeecccceeeeddddeeeedddd bbbbyyyy hhhhhhhh iiiiffff tttthhhheeee ccccoooorrrrrrrreeeessssppppoooonnnnddddiiiinnnngggg aaaarrrrgggguuuummmmeeeennnntttt iiiissss aaaa ppppooooiiiinnnntttteeeerrrr ttttoooo uuuunnnnssssiiiiggggnnnneeeedddd cccchhhhaaaarrrr rrrraaaatttthhhheeeerrrr tttthhhhaaaannnn aaaa ppppooooiiiinnnntttteeeerrrr ttttoooo uuuunnnnssssiiiiggggnnnneeeedddd iiiinnnntttt,,,, bbbbyyyy hhhh iiiiffff iiiitttt iiiissss aaaa ppppooooiiiinnnntttteeeerrrr ttttoooo uuuunnnnssssiiiiggggnnnneeeedddd sssshhhhoooorrrrtttt iiiinnnntttt,,,, IIIInnnn tttthhhheeee ssssaaaammmmeeee ppppaaaarrrraaaaggggrrrraaaapppphhhh,,,, cccchhhhaaaannnnggggeeee IIIIffff aaaannnn hhhh,,,, llll,,,, llllllll,,,, oooorrrr LLLL aaaappppppppeeeeaaaarrrrssss wwwwiiiitttthhhh aaaannnnyyyy ooootttthhhheeeerrrr ttttoooo IIIIffff aaaannnn hhhhhhhh,,,, hhhh,,,, llll,,,, llllllll,,,, oooorrrr LLLL aaaappppppppeeeeaaaarrrrssss wwwwiiiitttthhhh aaaannnnyyyy ooootttthhhheeeerrrr 15 Document No. WG14/N762 (J11/97-126)Minor Changes to C9_x September 26, 1997 22223333.... sssseeeeeeeekkkk oooonnnn ssssaaaammmmeeee ffffiiiilllleeee ooookkkkaaaayyyy 23.1 _t_h_e__p_r_o_b_l_e_m Seek offsets are required to be obtained from the same _s_t_r_e_a_m, not just from the same _f_i_l_e. That means one can't close a file and later reopen it and seek back into it. 23.2 _d_i_s_c_u_s_s_i_o_n It is _p_o_s_s_i_b_l_e that some operating system really imposes this limitation, but I don't recall any like that. My guess is that this was just imprecise wording that was never noticed. In the following, I rely on the vagueness of the phrase ``the same file'' to handle cases such as when a file is somehow modified between the time of the tell and the seek; this technicality (and a few similar complications) should have been dealt with even in the previous formulation. 23.3 _m_y__p_r_o_p_o_s_a_l In 7777....11112222....11110000....2222 TTTThhhheeee fseek ffffuuuunnnnccccttttiiiioooonnnn,,,, DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn, cccchhhhaaaannnnggggeeee aaaannnn eeeeaaaarrrrlllliiiieeeerrrr ssssuuuucccccccceeeessssssssffffuuuullll ccccaaaallllllll ttttoooo tttthhhheeee fffftttteeeellllllll ffffuuuunnnnccccttttiiiioooonnnn oooonnnn tttthhhheeee ssssaaaammmmeeee ssssttttrrrreeeeaaaammmm ttttoooo aaaannnn eeeeaaaarrrrlllliiiieeeerrrr ssssuuuucccccccceeeessssssssffffuuuullll ccccaaaallllllll ttttoooo tttthhhheeee fffftttteeeellllllll ffffuuuunnnnccccttttiiiioooonnnn oooonnnn aaaa ssssttttrrrreeeeaaaammmm aaaassssssssoooocccciiiiaaaatttteeeedddd wwwwiiiitttthhhh tttthhhheeee ssssaaaammmmeeee ffffiiiilllleeee IIIInnnn 7777....11112222....11110000....3333 TTTThhhheeee ffffsssseeeettttppppoooossss ffffuuuunnnnccccttttiiiioooonnnn,,,, DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn, cccchhhhaaaannnnggggeeee aaaannnn eeeeaaaarrrrlllliiiieeeerrrr ssssuuuucccccccceeeessssssssffffuuuullll ccccaaaallllllll ttttoooo tttthhhheeee ffffggggeeeettttppppoooossss ffffuuuunnnnccccttttiiiioooonnnn oooonnnn tttthhhheeee ssssaaaammmmeeee ssssttttrrrreeeeaaaammmm.... ttttoooo aaaannnn eeeeaaaarrrrlllliiiieeeerrrr ssssuuuucccccccceeeessssssssffffuuuullll ccccaaaallllllll ttttoooo tttthhhheeee ffffggggeeeettttppppoooossss ffffuuuunnnnccccttttiiiioooonnnn oooonnnn aaaa ssssttttrrrreeeeaaaammmm aaaassssssssoooocccciiiiaaaatttteeeedddd wwwwiiiitttthhhh tttthhhheeee ssssaaaammmmeeee ffffiiiilllleeee.... 22224444.... uuuusssseeee ooooffff aaaannnn uuuunnnnffffaaaammmmiiiilllliiiiaaaarrrr tttteeeerrrrmmmm 24.1 _t_h_e__p_r_o_b_l_e_m In the specification for strtod, what is a ``binary-exponent part''? 24.2 _m_y__p_r_o_p_o_s_a_l In 7777....11113333....1111....5555 TTTThhhheeee strtod ffffuuuunnnnccccttttiiiioooonnnn,,,, DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn, cccchhhhaaaannnnggggeeee tttthhhheeeennnn aaaannnn ooooppppttttiiiioooonnnnaaaallll bbbbiiiinnnnaaaarrrryyyy----eeeexxxxppppoooonnnneeeennnntttt ppppaaaarrrrtttt,,,, ttttoooo tttthhhheeeennnn aaaannnn ooooppppttttiiiioooonnnnaaaallll bbbbiiiinnnnaaaarrrryyyy----eeeexxxxppppoooonnnneeeennnntttt ppppaaaarrrrtttt aaaassss ddddeeeeffffiiiinnnneeeedddd iiiinnnn 16 September 26, 1997 Minor Changes to C9_xDocument No. WG14/N762 (J11/97-126) 6666....1111....3333....1111,,,, 22225555.... mmmmiiiissssssssiiiinnnngggg rrrreeeeffffeeeerrrreeeennnncccceeee ttttoooo CCCC88889999 25.1 _t_h_e__p_r_o_b_l_e_m Shouldn't there be a reference to our other base document, the previous C standard? 25.2 _m_y__p_r_o_p_o_s_a_l In AAAAnnnnnnnneeeexxxx AAAA BBBBiiiibbbblllliiiiooooggggrrrraaaapppphhhhyyyy, add the reference: 1. ISO/IEC 9899:1990, _P_r_o_g_r_a_m_m_i_n_g _L_a_n_g_u_a_g_e_s - _C. 26. mmmmiiiissssssssiiiinnnngggg rrrreeeessssttttrrrriiiicccctttt iiiinnnn AAAAnnnnnnnneeeexxxx BBBB 26.1 _t_h_e__p_r_o_b_l_e_m restrict is missing from the grammar in AAAAnnnnnnnneeeexxxx BBBB. 26.2 _m_y__p_r_o_p_o_s_a_l In BBBB....2222....2222 DDDDeeeeccccllllaaaarrrraaaattttiiiioooonnnnssss, add under (6.5.3) _t_y_p_e-_q_u_a_l_i_f_i_e_r: restrict 17