Bruno Haible <br...@clisp.org> writes: > int > mbsinit (const mbstate_t *ps) > { > const char *pstate = (const char *)ps; > > return pstate[0] == 0; > }
If I understand things correctly, this code is hijacking the underlying system's mbstate_t type and using it for its own purposes? The idea being that other gnulib code will be consistent with this? If so, perhaps this should appear in the source code, as a comment. (The idea of hijacking system data structures gives me the willies; I suppose it works on all the platforms we care about, but there should be a comment about it somewhere....) > We assume that > - sizeof (mbstate_t) >= 4, How about adding a "verify (sizeof (mbstate_t) >= 4);" so that this assumption is checked by the compiler? Or is there some concern that might define mbstate_t to be an incomplete type? (If so, that could be checked at configure-time, though this may be overkill....)