qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: Nickolai Zeldovich <nickolai@csail.mit.edu>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] readline: avoid memcpy() of overlapping regions
Date: Mon, 14 Jan 2013 10:09:35 +0100	[thread overview]
Message-ID: <20130114090935.GB11260@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <CAAu8pHsApm3wQJ-qk9am10AYupiTEkHMzrFxi_nvL5L7314puQ@mail.gmail.com>

On Sat, Jan 12, 2013 at 10:46:18AM +0000, Blue Swirl wrote:
> On Thu, Jan 10, 2013 at 12:43 PM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
> > On Wed, Jan 09, 2013 at 08:43:51PM +0000, Blue Swirl wrote:
> >> On Tue, Jan 8, 2013 at 9:03 AM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
> >> > On Mon, Jan 07, 2013 at 03:38:39PM -0500, Nickolai Zeldovich wrote:
> >> >> memcpy() for overlapping regions is undefined behavior; use memmove()
> >> >> instead in readline_hist_add().
> >> >>
> >> >> Signed-off-by: Nickolai Zeldovich <nickolai@csail.mit.edu>
> >> >> ---
> >> >>  readline.c |    4 ++--
> >> >>  1 file changed, 2 insertions(+), 2 deletions(-)
> >> >
> >> > I made a slight modification: keep the tab characters since the
> >> > surrounding code still uses them.
> >>
> >> I think tabs should be fixed whenever possible, otherwise we may never
> >> get them converted.
> >
> > Not in a one-line patch when the surrounding lines still use them.  It
> > creates a mess.
> 
> Only if the reader messes with the tab width settings (and in that
> case they deserve what they get and they are probably also used to
> this), otherwise a line with tabs converted to spaces looks exactly
> the same.

You are oversimplifying how tab widths work.  The author and reader's
tab width must match in order for displayed text to appear correctly.

Tell me what you consider the "correct" tab width for readers and I'll
find a piece of QEMU code that was authored for a different tab width
:).

In other words, it's a mess and best not to perturb it further.

Stefan

  reply	other threads:[~2013-01-14  9:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-07 20:38 [Qemu-devel] [PATCH] readline: avoid memcpy() of overlapping regions Nickolai Zeldovich
2013-01-07 21:36 ` Richard Henderson
2013-01-08  9:03 ` Stefan Hajnoczi
2013-01-09 20:43   ` Blue Swirl
2013-01-10 12:43     ` Stefan Hajnoczi
2013-01-12 10:46       ` Blue Swirl
2013-01-14  9:09         ` Stefan Hajnoczi [this message]
2013-01-17 20:13           ` Blue Swirl
2013-01-18 11:04             ` Stefan Hajnoczi
2013-01-19  9:04               ` Blue Swirl

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=20130114090935.GB11260@stefanha-thinkpad.redhat.com \
    --to=stefanha@gmail.com \
    --cc=blauwirbel@gmail.com \
    --cc=nickolai@csail.mit.edu \
    --cc=qemu-devel@nongnu.org \
    /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 NNTP newsgroup(s).