All of lore.kernel.org
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: Michael Buesch <mb@bu3sch.de>
Cc: Roel Kluin <roel.kluin@gmail.com>,
	stefano.brivio@polimi.it, linux-wireless@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] B43: misplaced parentheses?
Date: Sun, 15 Feb 2009 11:09:24 -0600	[thread overview]
Message-ID: <49984C44.7090005@lwfinger.net> (raw)
In-Reply-To: <200902151807.00311.mb@bu3sch.de>

Michael Buesch wrote:
> On Sunday 15 February 2009 18:05:52 Larry Finger wrote:
>> Roel Kluin wrote:
>>> -			  | (rfatt->with_padmix) ? txctl_value : 0);
>>> +			  | (rfatt->with_padmix ? txctl_value : 0));
>> As I see it, the difference between the above two lines is the same as the
>> difference between c and d in this program:
>>
>> int main(int argc, char **argv)
>> {
>>         int a = 1, b = 2, c, d;
>>
>>         c = (a) ? b : 0;
>>         d = (a ? b : 0);
>>         fprintf (stderr, "a, b, c, d: %d %d %d %d\n", a, b, c, d);
>>         return 1;
>> }
>>
>> When this program is executed, the output line is
>>
>> a, b, c, d: 1 2 2 2
>>
>> which is what I expected. Thus "(condition) ? result1 : result2" is the same as
>> "(condition ? result1 : result2)".
> 
> The problem is the binary OR operator, which has precedence over the ?: operator.

I see. Please ignore my noise.

Larry

      reply	other threads:[~2009-02-15 17:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-15 16:37 [PATCH] B43: misplaced parentheses? Roel Kluin
2009-02-15 16:46 ` Michael Buesch
2009-02-15 16:59   ` Michael Buesch
2009-02-15 17:05 ` Larry Finger
2009-02-15 17:07   ` Michael Buesch
2009-02-15 17:09     ` Larry Finger [this message]

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=49984C44.7090005@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=akpm@linux-foundation.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mb@bu3sch.de \
    --cc=roel.kluin@gmail.com \
    --cc=stefano.brivio@polimi.it \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.