bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: conflicting types for 'rpl_getcwd'


From: Eric Blake
Subject: Re: conflicting types for 'rpl_getcwd'
Date: Wed, 17 Aug 2011 10:22:41 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.11

On 08/17/2011 10:15 AM, Marc-André Lureau wrote:
Hi

I am trying to compile libvirt which uses gnulib on f16 mingw32:

make[4]: Entering directory `/usr/src/libvirt/gnulib/lib'
   CC     pipe2.lo
In file included from ./sys/stat.h:375:0,
                  from ./fcntl.h:56,
                  from pipe2.c:26:
/usr/i686-w64-mingw32/sys-root/mingw/include/direct.h:57:17: error:
conflicting types for 'rpl_getcwd'
./unistd.h:853:1: note: previous declaration of 'rpl_getcwd' was here
make[4]: *** [pipe2.lo] Error 1

Apparently, getcwd get replaced by gnulib, perhaps because:

configure:11532: checking whether getcwd (NULL, 0) allocates memory for result
configure:11597: result: guessing no

but there is already a declaration of getcwd in mingw direct.h:

   char *__cdecl getcwd(char *_DstBuf,int _SizeInBytes)
__MINGW_ATTRIB_DEPRECATED_MSVC2005;

Thanks for the report. The bug here is that gnulib's <unistd.h> header is missing a #include <direct.h> when compiling on mingw, to get the conflicting system declaration out of the way before doing the override.


If I put #include<unistd.h>  after #include<fcntl.h>, compilation goes on

Our goal is to make the gnulib headers usable in any order. So this workaround confirms that the problem is in gnulib's replacement headers, but changing pipe2.c is not the correct solution.

I'll see if I can reproduce the issue, and so, post a gnulib patch shortly.

--
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]