git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Ingo Molnar <mingo@elte.hu>
Cc: David Miller <davem@davemloft.net>,
	git@vger.kernel.org, imunsie@au1.ibm.com,
	linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl,
	paulus@samba.org, acme@redhat.com,
	kosaki.motohiro@jp.fujitsu.com, mitake@dcl.info.waseda.ac.jp,
	rusty@rustcorp.com.au, fweisbec@gmail.com, ebmunson@us.ibm.com,
	Valdis.Kletnieks@vt.edu, amwang@redhat.com, tfransosi@gmail.com,
	mhiramat@redhat.com, xiaoguangrong@cn.fujitsu.com,
	jaswinderrajput@gmail.com, arjan@linux.intel.com,
	hirofumi@mail.parknet.co.jp, efault@gmx.de, tzanussi@gmail.com,
	anton@samba.org, jkacur@redhat.com, lizf@cn.fujitsu.com,
	rostedt@goodmis.org
Subject: Re: [PATCH] perf: Fix endianness argument compatibility
Date: Wed, 14 Apr 2010 05:52:52 -0400	[thread overview]
Message-ID: <20100414095252.GA17884@coredump.intra.peff.net> (raw)
In-Reply-To: <20100414092843.GD10537@elte.hu>

On Wed, Apr 14, 2010 at 11:28:43AM +0200, Ingo Molnar wrote:

> > > Parsing an option from the command line with OPT_BOOLEAN on a bool data
> > > type would not work on a big-endian machine due to the manner in which
> > > the boolean was being cast into an int and incremented. For example,
> > > running 'perf probe --list' on a PowerPC machine would fail to properly
> > > set the list_events bool and would therefore print out the usage
> > > information and terminate.
> [...]
>
> Nice fix!
> 
> Btw., perf got the option parser from the Git project - i'm wondering how the 
> Git folks solved this endianness problem?

We didn't. We pass only actual ints for the value field in all cases. We
don't use C99 bools at all. We do use bit-fields, but the compiler
catches the error, since OPT_BOOLEAN tries to take its address.

-Peff

  reply	other threads:[~2010-04-14  9:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1271147857-11604-1-git-send-email-imunsie@au.ibm.com>
     [not found] ` <20100413.014821.34906166.davem@davemloft.net>
2010-04-14  9:28   ` [PATCH] perf: Fix endianness argument compatibility Ingo Molnar
2010-04-14  9:52     ` Jeff King [this message]
2010-04-14  9:36 ` [tip:perf/core] perf: Fix endianness argument compatibility with OPT_BOOLEAN() and introduce OPT_INCR() tip-bot for Ian Munsie
2010-04-14 15:12   ` Erik Faye-Lund
2010-04-14 15:12   ` Erik Faye-Lund

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=20100414095252.GA17884@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=amwang@redhat.com \
    --cc=anton@samba.org \
    --cc=arjan@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=ebmunson@us.ibm.com \
    --cc=efault@gmx.de \
    --cc=fweisbec@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=imunsie@au1.ibm.com \
    --cc=jaswinderrajput@gmail.com \
    --cc=jkacur@redhat.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=mhiramat@redhat.com \
    --cc=mingo@elte.hu \
    --cc=mitake@dcl.info.waseda.ac.jp \
    --cc=paulus@samba.org \
    --cc=rostedt@goodmis.org \
    --cc=rusty@rustcorp.com.au \
    --cc=tfransosi@gmail.com \
    --cc=tzanussi@gmail.com \
    --cc=xiaoguangrong@cn.fujitsu.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 NNTP newsgroup(s).