The recent change [1] to gettext.h of replacing free() with
xfree() has generated many warnings on MSVC:

  cl -nologo -MD ... -c cookies.c
  g:\mingw32\src\inet\wget\src\gettext.h(218) : warning C4013: 'xfree' 
undefined;
  assuming extern returning int

The cause is in "gettext.h" (the package from Hell IMHO.
"gettext.h" is included in "wget.h" before "utils.h" which
defines xfree):
 #define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \
  (((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \
   /* || __STDC_VERSION__ >= 199901L */ )

I.e. GNU only. So what to do? Here I just did:
  @@ -176,6 +176,7 @@

   #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
   #include <stdlib.h>
  +#define xfree free
   #endif

Wasn't there an alloca() discussion recently? Why not use
that instead? far more portable IMHO.

[1]: 2014-11-27  Darshit Shah  <[email protected]>

        * cookies.c, gettext.h, init.c, retr.c, url.c, warc.c: Replace usage of
        free() with xfree() macro.

--
--gv

Reply via email to