Chris Pickett wrote:
Eric Blake wrote:
Which means that either AC_USE_SYSTEM_EXTENSIONS needs to be taught how to
override 'cc -ansi' on mingw, or you are getting exactly what you asked
for by asking for such a strict compilation environment, since strdup is
_not_ an ansi function.

I use -ansi for its other features. Maybe all that's needed is for AC_USE_SYSTEM_EXTENSIONS to #undef __STRICT_ANSI__? I think this is logical, but I lack the experience to say whether it breaks things.

I looked at lib/autoconf/specific.m4 and read the manual on Autoheader macros, and it seems like this isn't easy. We want:

#ifdef __STRICT_ANSI__
# undef __STRICT_ANSI__
#endif

to be generated in config.h (or rather, I claim that we want that), but any #undef in config.h gets either turned into a #define or commented out!

   `Currently, _all_ remaining `#undef' lines in the header template are
commented out, whether or not there was a corresponding `AC_DEFINE' for
the macro name; but this behavior is not guaranteed for future releases
of Autoconf.'

Can it be done safely with a call to AH_BOTTOM inside AC_USE_SYSTEM_EXTENSIONS?

Chris


Reply via email to