public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* warning: 'sbrk' is deprecated
@ 2015-02-24 16:38 Jack Howarth
  2015-02-26 17:52 ` Jack Howarth
  0 siblings, 1 reply; 2+ messages in thread
From: Jack Howarth @ 2015-02-24 16:38 UTC (permalink / raw)
  To: gdb

   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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: warning: 'sbrk' is deprecated
  2015-02-24 16:38 warning: 'sbrk' is deprecated Jack Howarth
@ 2015-02-26 17:52 ` Jack Howarth
  0 siblings, 0 replies; 2+ messages in thread
From: Jack Howarth @ 2015-02-26 17:52 UTC (permalink / raw)
  To: gdb

   The current gdb/configure doesn't seem to support passing
ac_cv_func_sbrk=no to configure as a mechanism to suppress the
deprecated use of sbrk() on darwin.

for ac_func in getrusage getuid getgid \
                pipe poll pread pread64 pwrite resize_term \
                sbrk setpgid setpgrp setsid \
                sigaction sigprocmask sigsetmask socketpair \
                ttrace wborder wresize setlocale iconvlist libiconvlist btowc \
                setrlimit getrlimit posix_madvise waitpid \
                ptrace64 sigaltstack mkdtemp
do :
  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
eval as_val=\$$as_ac_var
   if test "x$as_val" = x""yes; then :
  cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF

fi
done

              Jack

On Tue, Feb 24, 2015 at 11:38 AM, Jack Howarth
<howarth.mailing.lists@gmail.com> wrote:
>    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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-02-26 17:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-24 16:38 warning: 'sbrk' is deprecated Jack Howarth
2015-02-26 17:52 ` Jack Howarth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).