Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Pedro Alves <palves@redhat.com>
Cc: Tom Tromey <tom@tromey.com>,  gdb-patches@sourceware.org
Subject: Re: [RFA 3/3] Special case NULL when using printf's %s format
Date: Fri, 16 Feb 2018 21:58:00 -0000	[thread overview]
Message-ID: <87zi484mx0.fsf@tromey.com> (raw)
In-Reply-To: <5843def6-8004-4103-188c-50125c7b3d9f@redhat.com> (Pedro Alves's	message of "Fri, 16 Feb 2018 12:25:32 +0000")

Pedro> Then again, I don't think it's likely that programs map
Pedro> strings at 0 (I think it's more like interrupt vectors), so for %s,
Pedro> it's likely that nobody would miss printing 0 as a string.

Another option would be to do a try-catch and only print "(null)" on
failure, if the pointer is 0.

Tom


  reply	other threads:[~2018-02-16 21:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-15 20:50 [RFA 0/3] a few minor printf fixes Tom Tromey
2018-02-15 20:50 ` [RFA 2/3] Allow - in %p for printf Tom Tromey
2018-02-16 11:31   ` Alan Hayward
2018-02-27  3:50     ` Tom Tromey
2018-02-15 20:50 ` [RFA 1/3] Add usage to printf command Tom Tromey
     [not found]   ` <9E6EDAE0-C429-4581-9CAA-FF7B88796D40@arm.com>
2018-02-16 21:58     ` Tom Tromey
2018-02-16 23:09       ` Simon Marchi
2018-02-19  9:16         ` Alan Hayward
2018-02-15 20:50 ` [RFA 3/3] Special case NULL when using printf's %s format Tom Tromey
     [not found]   ` <6abda67a-ad87-ebc7-e0d4-ab60e7e4cbc6@redhat.com>
2018-02-16 12:25     ` Pedro Alves
2018-02-16 21:58       ` Tom Tromey [this message]
2018-03-14 15:44 ` [RFA 0/3] a few minor printf fixes Tom Tromey

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=87zi484mx0.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.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