bug-bash
[Top][All Lists]
Advanced

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

Re: Error: conflicting types for ‘sbrk’


From: Larissa Braz
Subject: Re: Error: conflicting types for ‘sbrk’
Date: Mon, 2 Apr 2018 14:30:07 -0300

Dear Eduardo,

2018-03-22 11:36 GMT-03:00 Eduardo A. Bustamante López <address@hidden>:

> On Wed, Mar 21, 2018 at 11:07:45AM -0300, Larissa Braz wrote:
> > Hi,
> >
> >  I found the following compilation error:
> >
> > xmalloc.c:51:14: error: conflicting types for ‘sbrk’
> >  extern char *sbrk();
> >               ^
> > In file included from xmalloc.c:29:0:
> > /usr/include/unistd.h:1043:14: note: previous declaration of ‘sbrk’ was
> here
> >  extern void *sbrk (intptr_t __delta) __THROW;
> [...]
> > #if defined (HAVE_SBRK) && !HAVE_DECL_SBRK
> > extern char *sbrk();
> > #endif
>
> This declaration is conditional. It will only be evaluated if
>
>   HAVE_SBRK=1
>   HAVE_DECL_SBRK=0
>
> These are set by the configure script based on what it can detect from your
> system. It is strange that it detects a
> working sbrk implementation, but no sbrk declaration.
>
> * What source tree are you building? (i.e. git devel branch, git master
> branch,
>   tarball?)
>
The git master branch.

> * Also, are you passing any special parameters to `configure' or `make'?
>
Actually, I'm evaluating some possible combination of macros, such as the
one where the error occurs. So, I manually change the configure file. I
haven't found any configuration constraint file or directions that tell me
this specific configuration isn't allowed. Is there any place I can find
it?

> * Can you share the following blocks from your config.log and config.h
> after
>   running the configure script?
>
>
>     $ grep -i 'checking for.*sbrk' config.log -A5
>     configure:10615: checking for sbrk
>     configure:10615: gcc -o conftest -ggdb -O0 -Wno-parentheses
> -Wno-format-security   conftest.c  >&5
>     configure:10615: $? = 0
>     configure:10615: result: yes
>     configure:10615: checking for fpurge
>     configure:10615: gcc -o conftest -ggdb -O0 -Wno-parentheses
> -Wno-format-security   conftest.c  >&5
>     --
>     configure:14469: checking for working sbrk
>     configure:14496: gcc -o conftest -ggdb -O0 -Wno-parentheses
> -Wno-format-security   conftest.c -ldl  >&5
>     configure:14496: $? = 0
>     configure:14496: ./conftest
>     configure:14496: $? = 0
>     configure:14506: result: yes
>

configure:9811: checking for sbrk
configure:9811: gcc -o conftest -g -O2 -Wno-parentheses
-Wno-format-security   conftest.c  >&5
configure:9811: $? = 0
configure:9811: result: yes
configure:9811: checking for select
configure:9811: gcc -o conftest -g -O2 -Wno-parentheses
-Wno-format-security   conftest.c  >&5

>
>     $ grep SBRK config.h
>     #define HAVE_DECL_SBRK 1
>     #define HAVE_SBRK 1
>
    #define HAVE_DECL_SBRK 0
    #define HAVE_SBRK 1

Thank you,

-- 
Larissa Braz


reply via email to

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