Opened 14 years ago
Closed 13 years ago
#242 closed defect (invalid)
sbrk/_sbrk conflicting declarations
Reported by: | Yuri Dario | Owned by: | bird |
---|---|---|---|
Priority: | highest | Milestone: | libc-0.6.5 |
Component: | libc-frontend | Version: | 0.6.2 |
Severity: | critical | Keywords: | |
Cc: |
Description
While building gnu tar, the following conflict exists in headers:
F:/usr/bin/../lib/gcc/../../include/unistd.h:476: error: conflicting types for ' sbrk' F:/usr/bin/../lib/gcc/../../include/stdlib.h:387: note: previous declaration of 'sbrk' was here F:/usr/bin/../lib/gcc/../../include/unistd.h:650: error: conflicting types for ' _sbrk' F:/usr/bin/../lib/gcc/../../include/stdlib.h:416: note: previous declaration of '_sbrk' was here
it seems to me that unistd.h is the correct header, I deleted stdlib.h entries.
Change History (2)
comment:1 by , 14 years ago
comment:2 by , 13 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
I fail to see what needs fixing in libc here. unistd.h and stdlib.h are both defining _sbrk and sbrk taking intptr_t as argument. Maybe stdlib.h shouldn't define sbrk, but that's an EMXism and dare not change right now.
Hi/2.
It's not a problem of kLIBC, but gnulib-lib. It re-defines intptr_t and uintptr_t as its own gl_intptr_t and gl_uintptr_t in its own stdint.h using "include_next".
BTW, it defines gl_inptr_t and gl_uintptr_t to long int and unsigned long, respectively. But kLIBC uses int and unsigned int.
So you need to modify stdint.in.h of gnulib-lib. I'm using the following patch for libiconv and gettext.