This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

warning: 'sbrk' is deprecated


   Building gdb 7.9 on x86_64-apple-darwin14, produces the warnings...

maint.c:864:28: warning: 'sbrk' is deprecated [-Wdeprecated-declarations]
      char *lim = (char *) sbrk (0);
                           ^
/usr/include/unistd.h:582:7: note: 'sbrk' has been explicitly marked
deprecated here
void    *sbrk(int);
         ^
maint.c:924:28: warning: 'sbrk' is deprecated [-Wdeprecated-declarations]
      char *lim = (char *) sbrk (0);
                           ^
/usr/include/unistd.h:582:7: note: 'sbrk' has been explicitly marked
deprecated here
void    *sbrk(int);
         ^
./xmalloc.c:112:28: warning: 'sbrk' is deprecated [-Wdeprecated-declarations]
    first_break = (char *) sbrk (0);
                           ^
/usr/include/unistd.h:582:7: note: 'sbrk' has been explicitly marked
deprecated here
void    *sbrk(int);
         ^

./xmalloc.c:124:26: warning: 'sbrk' is deprecated [-Wdeprecated-declarations]

    allocated = (char *) sbrk (0) - first_break;

                         ^

/usr/include/unistd.h:582:7: note: 'sbrk' has been explicitly marked
deprecated here

void    *sbrk(int);

         ^

./xmalloc.c:126:26: warning: 'sbrk' is deprecated [-Wdeprecated-declarations]
    allocated = (char *) sbrk (0) - (char *) &environ;
                         ^
/usr/include/unistd.h:582:7: note: 'sbrk' has been explicitly marked
deprecated here
void    *sbrk(int);
         ^

main.c:232:56: warning: adding 'int' to a string does not append to
the string [-Wstring-plus-int]
              char *tmp_sys_gdbinit = xstrdup (SYSTEM_GDBINIT + datadir_len);
                                               ~~~~~~~~~~~~~~~^~~~~~~~~~~~~
main.c:232:56: note: use array indexing to silence this warning
              char *tmp_sys_gdbinit = xstrdup (SYSTEM_GDBINIT + datadir_len);
                                                              ^
                                               &              [            ]
main.c:477:27: warning: 'sbrk' is deprecated [-Wdeprecated-declarations]
  lim_at_start = (char *) sbrk (0);
                          ^
/usr/include/unistd.h:582:7: note: 'sbrk' has been explicitly marked
deprecated here
void    *sbrk(int);
         ^

This code should be rewritten on darwin to avoid the depreciated sbrk() calls.
                Jack


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]