-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Bruno Haible on 12/20/2008 7:40 AM: > Indeed. The mbstate_t type and mbsinit etc. functions were not part of > C89 + appendices, they were introduced in C99. Therefore, the > -D_XOPEN_SOURCE=500 option should better be added to the detection of flags > for C99, not C89. (But be careful to use it only for HP-UX! On other systems, > this flag is very likely to cause damage.) > > OTOH, AC_PROG_CC (which is what nearly every packages uses) assumes the > user wants C89, not C99. Hmm?
Actually, it doesn't even assume that, yet. As has been discussed on the list in the past, AC_PROG_CC still supports K&R by default. We've talked about changing things, so that C89 is default and you have to be explicit to get K&R, but no one has written the patch yet. On the other hand, the fact that C89 does not define mbstate_t seems to answer the question. We need to guarantee that AC_USE_SYSTEM_EXTENSIONS (which works regardless of C flavor) and AC_PROG_CC_C99 both guarantee the define, then applications that explicitly ask for extensions, as well as applications that explicitly ask for C99, will get what they need. We can also add a paragraph in the autoconf manual mentioning that mbstate_t is not guaranteed by the default AC_PROG_CC, and that you need either (or both) AC_USE_SYSTEM_EXTENSIONS or AC_PROG_CC_C99. - -- Don't work too hard, make some time for fun as well! Eric Blake e...@byu.net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAklNGaYACgkQ84KuGfSFAYDdNACffETHfasRVvyFm/dhND4q2RzA XpgAn2ydXEg7XvfamWI98zZBQCLW0IGH =lo2d -----END PGP SIGNATURE-----