On Wed, Dec 05, 2007 at 09:51:15PM +0100, Jim Meyering wrote:
"Richard W.M. Jones" <rjones(a)redhat.com> wrote:
> Jim, to use the gnulib <string.h> replacement with GCC 4.1.2 compiled
> under MinGW, I needed to patch lib/string.h as follows:
>
> --- gnulib/lib/string.h~ 2007-12-05 18:29:29.000000000 +0000
> +++ gnulib/lib/string.h 2007-12-05 19:36:22.000000000 +0000
> @@ -280,7 +280,7 @@
> See also strtok_r(). */
> #if 1
> # if ! 0
> -extern char *strsep (char **restrict __stringp, char const *restrict
> __delim);
> +extern char *strsep (char **__restrict__ __stringp, char const
> *__restrict__ __delim);
> # endif
> # if defined GNULIB_POSIXCHECK
> # undef strsep
>
> This seems to be because C99's restrict keyword is not enabled by
> default. You need to pass the -std=c99 parameter to the compiler to
> get this.
Thanks for the report.
That file is generated from string.in.h, based on
settings determined at configure time.
And one of the autoconf checks performed for the string module
is to require the AC_C_RESTRICT macro which is supposed to
detect which flavor of restrict to use. Then it puts the appropriate
definition of e.g.
#define restrict __restrict__
in config.h.
Ahh... I've got it.
There are a bunch of files that don't include config.h.
There's a rule in "autoconf" land saying that
nearly every .c file should include "config.h" before anything else.
Most of the time people don't notice when it's forgotten, but
porting to "different" systems highlights the trouble.
You can list the files that include string.h yet do *not* include config.h,
git-grep -l 'include <string\.h>'|xargs grep -L config.h
And here's a proposed patch to fix those.
There may well be others, but this should solve your build failure:
Include "config.h".
* qemud/event.c: Likewise.
* src/buf.c: Likewise.
* src/hash.c: Likewise.
* src/nodeinfo.c: Likewise.
* src/openvz_conf.c: Likewise.
* src/proxy_internal.c: Likewise.
* src/virterror.c: Likewise.
* src/xmlrpc.c: Likewise.
* src/xs_internal.c: Likewise.
* tests/conftest.c: Likewise.
* tests/xmlrpctest.c: Likewise.
Hum, right, that should be commited to CVS, this makes sense even
if gnulib is not in yet,
thanks !
Daniel
--
Red Hat Virtualization group
http://redhat.com/virtualization/
Daniel Veillard | virtualization library
http://libvirt.org/
veillard(a)redhat.com | libxml GNOME XML XSLT toolkit
http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine
http://rpmfind.net/