On 01/19/2011 10:45 PM, Jan Djärv wrote: > /* config.h #define:s malloc/realloc/free and then includes stdlib.h. > We want the undefined versions, but if config.h includes stdlib.h > with the #define:s in place, the prototypes will be wrong and we get > warnings. To prevent that, include stdlib.h before config.h. */
OK, I see. There's a better way, one that doesn't potentially mess up the ABI. Namely, Emacs can supply a stdlib.h wrapper that #defines malloc/realloc/free the way we like. gnulib already does that, but Emacs doesn't use gnulib's stdlib.h wrapper. At some point, perhaps Emacs will, and then we can look into this issue again. Is stdlib.h the only include file that has the problem? If so, I suggest modifying unexmacosx.c to include <stdlib.h> first, <config.h> second, and everything else after that. That should lessen the likelihood of an ABI mismatch. If not, then what other include files have the problem? This issue may come up if we add more wrappers from gnulib.