On 6/23/2011 5:34 AM, Vadim Zeitlin wrote:
> Re-declaring _putenv() without _CRTIMP in strict ANSI mode when using MinGW
> resulted in a warning because of a conflict with the previous declaration that
> did use _CRTIMP.
> 
> Simply add _CRTIMP to our declaration to avoid it.

> -int _putenv (const char *);
> +_CRTIMP int _putenv (const char *);

Probably should also add __cdecl (for correctness, not warning
suppression) in case the user has done a -mrtd.

_CRTIMP int __cdecl _putenv (const char*);

However, no need for __MINGW_NOTHROW, I think, because gcc does not
appear to give this warning when "redeclarations" only differ by missing
attributes (in this case, __attribute__ ((__nothrow__)) ).

The larger issue, of course, is that we need to implement
LT_WRAPPER_CFLAGS variable (*), that strips out warning flags and
especially -Werror and its other-compiler analogues from the user's
C[,PP,XX]FLAGS -- otherwise, we will continue to hit this "problem" over
and over.

This is the third or fourth time we've had to update the c-wrapper code
for similar issues.

(*) Dunno what the correct name should be.  LT_CFLAGS_FOR_BUILD or
similar is /wrong/, because the wrapper is actually built for $host.

--
Chuck

Reply via email to