[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-wget] 'xfree' undefined
From: |
Gisle Vanem |
Subject: |
[Bug-wget] 'xfree' undefined |
Date: |
Thu, 27 Nov 2014 17:32:17 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 5.1; rv:33.0) Gecko/20100101 Firefox/33.0 SeaMonkey/2.30 |
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 <address@hidden>
* cookies.c, gettext.h, init.c, retr.c, url.c, warc.c: Replace usage of
free() with xfree() macro.
--
--gv
- [Bug-wget] 'xfree' undefined,
Gisle Vanem <=