[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Error: conflicting types for ‘sbrk’
From: |
Larissa Braz |
Subject: |
Error: conflicting types for ‘sbrk’ |
Date: |
Wed, 21 Mar 2018 11:07:45 -0300 |
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;
^
The code where it occurs is bellow.
//unistd.h
#if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K) \
|| defined __USE_MISC
extern void *sbrk (intptr_t __delta) __THROW;
#endif
//xmalloc.c
...
#if defined (HAVE_UNISTD_H)
# include <unistd.h>
#endif
...
#if defined (HAVE_SBRK) && !HAVE_DECL_SBRK
extern char *sbrk();
#endif
I'm using gcc version 4.8.4 and Ubuntu 14.04 LTS.
Thank you,
--
Larissa Braz
- Error: conflicting types for ‘sbrk’,
Larissa Braz <=