public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bernd Schmidt <bschmidt@redhat.com>
To: Martin Sebor <msebor@gmail.com>,
	Gcc Patch List <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] add uClibc target hook (PR bootstrap/77819)
Date: Tue, 04 Oct 2016 08:42:00 -0000	[thread overview]
Message-ID: <e6bb56c2-57da-aa53-9cc7-a9b1370aa494@redhat.com> (raw)
In-Reply-To: <52a0ea48-cbfd-28c8-4711-22cea9481d1a@gmail.com>

On 10/03/2016 12:02 AM, Martin Sebor wrote:
> I couldn't find a good uclibc-only file where to put the new
> definition of the hook so I conditionally added it to
> targethooks.c.

> diff --git a/gcc/targhooks.c b/gcc/targhooks.c
> index d75650f..77b4a18 100644
> --- a/gcc/targhooks.c
> +++ b/gcc/targhooks.c
> @@ -1523,6 +1523,26 @@ default_printf_pointer_format (tree, const char **flags)
>    return "%zx";
>  }
>
> +#if (DEFAULT_LIBC == LIBC_UCLIBC) && defined (SINGLE_LIBC) /* uClinux */

I think DEFAULT_LIBC is defined only for linux targets, so this won't 
do. Just define unconditionally, with a declaration in targhooks.h?

> +const char*
> +uclibc_printf_pointer_format (tree arg, const char **flags)
> +{
> +  *flags = " +";
> +
> +  return arg && integer_zerop (arg) ? "(nil)" : "%#zx";
> +}

Then again, maybe also just move the hook from linux.c here, it appears 
identical.


Bernd

  reply	other threads:[~2016-10-04  8:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-02 22:02 Martin Sebor
2016-10-04  8:42 ` Bernd Schmidt [this message]
2016-10-04 14:34   ` Martin Sebor
2016-10-04 14:54     ` Bernd Schmidt
2016-10-04 20:25       ` Martin Sebor
2016-10-05 10:38         ` Bernd Schmidt

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=e6bb56c2-57da-aa53-9cc7-a9b1370aa494@redhat.com \
    --to=bschmidt@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=msebor@gmail.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).