basename conflicting definitions

Corinna Vinschen corinna-cygwin@cygwin.com
Tue Apr 21 09:21:00 GMT 2015


On Apr 21 10:44, Marco Atzeri wrote:
> 
> 
> On 4/21/2015 9:38 AM, Corinna Vinschen wrote:
> >Hi Marco,
> >
> >On Apr 21 07:31, Marco Atzeri wrote:
> >>Hi Corinna,
> >>building open-mpi on
> >>
> >>  $ uname -svrm
> >>CYGWIN_NT-6.1 2.0.0(0.287/5/3) 2015-04-17 12:08 x86_64
> >>
> >>I see a conflict from 2 header of
> >>
> >>$ cygcheck -f /usr/include/libgen.h /usr/include/string.h
> >>cygwin-devel-2.0.0-0.7
> >>cygwin-devel-2.0.0-0.7
> >>
> >>
> >>configure:59845: gcc -std=gnu99 -c -DNDEBUG -ggdb -O2 -pipe
> >>-Wimplicit-function-declaration -fdebug-prefix-map=/pub/devel/openmpi/openmpi-1.8.5pre2-1.x86_64/build=/usr/src/debug/openmpi-1.8.5pre2-1 -fdebug-prefix-map=/pub/devel/openmpi/openmpi-1.8.5pre2-1.x86_64/src/openmpi-1.8.5pre2=/usr/src/debug/openmpi-1.8.5pre2-1
> >>-finline-functions -fno-strict-aliasing -fexceptions  conftest.c >&5
> >>In file included from conftest.c:429:0:
> >>/usr/include/libgen.h:18:14: error: conflicting types for 'basename'
> >>  extern char *basename (char *path);
> >>               ^
> >>In file included from /usr/include/stdio.h:29:0,
> >>                  from conftest.c:396:
> >>/usr/include/string.h:172:7: note: previous declaration of 'basename' was
> >>here
> >>  char *_EXFUN(basename,(const char *))
> >>        ^
> >
> >That's Yaakov's patch to introduce GNU basename with the different
> >behaviour depending whether you include via libgen.h or via #define
> >_GNU_SOURCE, string,h.
> >
> >Which one is it here?  The conflict shouldn't occur, one of them should
> >have been filtered out based on the order.
> >
> >
> >Corinna
> >
> 
> 
> libgen.h check
> 
> AC_CHECK_HEADERS([alloca.h aio.h arpa/inet.h dirent.h \
>     dlfcn.h execinfo.h err.h fcntl.h grp.h inttypes.h libgen.h
>    ....
> 
> attached extract from the config.log

Yep, easily reproducible.  This doesn't occur on Linux because the
preprocessor guarding always prefers the POSIX version from libgen.h
over the GNU version in string.h  This needs a change, but it's a
bit tricky, given that our functions are defined upside down from
the glibc versions:

          GNU              POSIX

GLIBC:    basename         __xpg_basename
Newlib:   __gnu_basename   basename

This complicates getting the same result independent of the inclusion
order a bit...


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20150421/e6a25980/attachment.sig>


More information about the Cygwin mailing list