public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH] perf: Fix accidentally preprocessed snprintf callback
Date: Tue, 13 Apr 2010 23:28:00 -0300	[thread overview]
Message-ID: <20100414022800.GE25649@ghostprotocols.net> (raw)
In-Reply-To: <20100414004115.GI5602@nowhere>

Em Wed, Apr 14, 2010 at 02:41:16AM +0200, Frederic Weisbecker escreveu:
> On Wed, Apr 14, 2010 at 02:37:48AM +0200, Frederic Weisbecker wrote:
> > struct sort_entry has a callback named snprintf that turns an
> > entry into a string result.
> > 
> > But there are glibc versions that implement snprintf through a
> > macro. The following expression is then going to get the snprintf
> > call preprocessed:
> > 
> > 	ent->snprintf(...)
> > 
> > to finally end up in a build error:
> > 
> > 	util/hist.c: Dans la fonction «hist_entry__snprintf» :
> > 	util/hist.c:539: erreur: «struct sort_entry» has no member named «__builtin___snprintf_chk»
> > 
> > To fix this, rename struct sort_entry::snprintf() callback to
> > to_string(), assuming at least Java methods naming won't ever
> > conflict with perf.
> 
> 
> Note I'm not entirely happy with this to_string() renaming.
> May be append_string() would have been better. I don't know.
> snprintf() was just too good.
> If you think about something else, don't hesistate to change,
> or I can change it myself if you want.

psnprintf() I guess, the intent was exactly to mean that it is indeed
similar to snprintf... dammit, there is already a psnprintf out there
:-\

Perhaps just do it as ->he_snprintf and have the other methods as well
prefixed with he as a shorthand for hist_entry, that is what the methods
operate, besides the string, ok?

- Arnaldo

  reply	other threads:[~2010-04-14  2:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-14  0:37 [PATCH] perf: Fix accidentally preprocessed snprintf callback Frederic Weisbecker
2010-04-14  0:41 ` Frederic Weisbecker
2010-04-14  2:28   ` Arnaldo Carvalho de Melo [this message]
2010-04-14 14:55     ` Frederic Weisbecker
2010-04-14 17:09     ` [PATCH v2] struct sort_entry has a callback named snprintf that turns an entry into a string result Frederic Weisbecker
2010-04-14 17:11 ` [PATCH v3] perf: Fix accidentally preprocessed snprintf callback Frederic Weisbecker
2010-04-14 17:31   ` Arnaldo Carvalho de Melo

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=20100414022800.GE25649@ghostprotocols.net \
    --to=acme@infradead.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.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