public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Yunlian Jiang <yunlian@google.com>
To: Ian Lance Taylor <iant@google.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH/libiberty] fix build of gdb/binutils with clang.
Date: Fri, 01 May 2015 23:45:00 -0000	[thread overview]
Message-ID: <CAMsPy2v+MduooHaBA8hhiTcrq_1NeQm1X-LnOrMEoouUQii4kg@mail.gmail.com> (raw)
In-Reply-To: <CAKOQZ8wXKGAxKgcetJxPPWXgxaeNrbLf-E_o6Tz2zbjYF6VfQg@mail.gmail.com>

The test case does not have #define _GNU_SOURCE, so it says
error: ‘asprintf’ undeclared (first use in this function)

On Fri, May 1, 2015 at 3:45 PM, Ian Lance Taylor <iant@google.com> wrote:
> On Tue, Apr 28, 2015 at 2:59 PM, Yunlian Jiang <yunlian@google.com> wrote:
>> I believe this is the same problem as
>> https://gcc.gnu.org/ml/gcc-patches/2008-07/msg00292.html
>>
>> The asprinf declaration is  messed up when using clang to build gdb.
>>
>> diff --git a/include/libiberty.h b/include/libiberty.h
>> index b33dd65..a294903 100644
>> --- a/include/libiberty.h
>> +++ b/include/libiberty.h
>> @@ -625,8 +625,10 @@ extern int pwait (int, int *, int);
>>  /* Like sprintf but provides a pointer to malloc'd storage, which must
>>     be freed by the caller.  */
>>
>> +#ifndef asprintf
>>  extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2;
>>  #endif
>> +#endif
>>
>>  /* Like asprintf but allocates memory without fail. This works like
>>     xmalloc.  */
>
> Why is HAVE_DECL_ASPRINTF not defined?
>
> Ian

  reply	other threads:[~2015-05-01 23:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-28 22:30 Yunlian Jiang
2015-05-01 22:45 ` Ian Lance Taylor
2015-05-01 23:45   ` Yunlian Jiang [this message]
2015-05-02 18:58     ` Ian Lance Taylor
2015-05-04 22:49       ` Yunlian Jiang
2015-05-05  0:30         ` Ian Lance Taylor
2015-05-18 23:52           ` Yunlian Jiang
2015-05-19  0:15             ` Ian Lance Taylor
2015-05-19 18:15               ` Yunlian Jiang
2015-05-19 18:16                 ` Ian Lance Taylor
2015-05-20 18:28                   ` Yunlian Jiang
2015-05-20 20:15                     ` Ian Lance Taylor
2015-05-20 23:27                       ` Yunlian Jiang
2015-05-22 21:25                         ` Ian Lance Taylor
2015-05-19 18:16                 ` DJ Delorie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMsPy2v+MduooHaBA8hhiTcrq_1NeQm1X-LnOrMEoouUQii4kg@mail.gmail.com \
    --to=yunlian@google.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=iant@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).