Ben Pfaff wrote: > Eric Blake <e...@byu.net> writes: > >> Jim Meyering <jim <at> meyering.net> writes: >>> -mbstate_t _gl_mbsrtowcs_state = 0; >>> +mbstate_t _gl_mbsrtowcs_state = { 0, }; >> Is this correct for all platforms? If I read Posix correctly, mbstate_t can >> be >> a numeric type rather than a struct. > > The initializer for an object scalar type may optionally be > enclosed in braces. From C99 6.7.8 "Initialization", paragraph > 11: > > The initializer for a scalar shall be a single > expression, optionally enclosed in braces. > > C89 had similar text.
Yes. What about the comma, though? GCC doesn't complain (even with -ansi -pedantic), but I think a very strict reading might suggest a conforming implementation could consider it to have undefined behavior ("shall"). -- Micah J. Cowan Programmer, musician, typesetting enthusiast, gamer. Maintainer of GNU Wget and GNU Teseq http://micah.cowan.name/