From: Andrew Morton <akpm@osdl.org>
To: "Randy.Dunlap" <rdunlap@xenotime.net>
Cc: arjan@infradead.org, torvalds@osdl.org, tglx@linutronix.de,
mingo@elte.hu, rmk+lkml@arm.linux.org.uk,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] genirq: ARM dyntick cleanup
Date: Wed, 5 Jul 2006 16:35:30 -0700 [thread overview]
Message-ID: <20060705163530.bfe5a8f0.akpm@osdl.org> (raw)
In-Reply-To: <20060705162425.547f3d3f.rdunlap@xenotime.net>
On Wed, 5 Jul 2006 16:24:25 -0700
"Randy.Dunlap" <rdunlap@xenotime.net> wrote:
> On Mon, 03 Jul 2006 19:27:07 +0200 Arjan van de Ven wrote:
>
> > On Mon, 2006-07-03 at 10:13 -0700, Linus Torvalds wrote:
> > > #ifndef xyzzy
> > > #define zyzzy() /* empty */
> > > #endif
> > >
> >
> > now if you write it as
> >
> > #define zyzzy() do { ; } while (0)
> >
> > it even works in a
> >
> > if (foo())
> > zyzzy();
> > bar();
> >
> > scenario
> >
> > (I know you know that, just pointing that out before people copy your
> > example :-)
>
> OK, I'll bite. What part of Linus's macro doesn't work.
> I compiled your foo/zyzzy/bar example with both his "empty"
> macro and the do-while macro. Same code produced both ways,
> no compile warnings/errors.
>
if (foo())
;
will generate `warning: empty body in an if-statement' when compiled with -W.
We go round this loop regularly. Maybe someone should write it up. Meanwhile,
use do{}while(0) and be happy and secure.
next prev parent reply other threads:[~2006-07-05 23:35 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-03 0:18 [PATCH] genirq: ARM dyntick cleanup Thomas Gleixner
2006-07-03 0:35 ` Andrew Morton
2006-07-03 6:29 ` Thomas Gleixner
2006-07-03 6:57 ` Ingo Molnar
2006-07-04 11:54 ` Christoph Hellwig
2006-07-04 12:22 ` Ingo Molnar
2006-07-05 8:35 ` Russell King
2006-07-08 18:53 ` Christoph Hellwig
2006-07-03 7:41 ` Russell King
2006-07-03 7:55 ` Andrew Morton
2006-07-03 9:03 ` Russell King
2006-07-03 9:12 ` Andrew Morton
2006-07-03 16:56 ` Linus Torvalds
2006-07-03 17:13 ` Linus Torvalds
2006-07-03 17:27 ` Arjan van de Ven
2006-07-05 23:24 ` Randy.Dunlap
2006-07-05 23:35 ` Andrew Morton [this message]
2006-07-05 23:50 ` Randy.Dunlap
2006-07-05 23:53 ` Linus Torvalds
2006-07-06 0:02 ` Randy.Dunlap
2006-07-06 6:47 ` Giacomo A. Catenazzi
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=20060705163530.bfe5a8f0.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=arjan@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rdunlap@xenotime.net \
--cc=rmk+lkml@arm.linux.org.uk \
--cc=tglx@linutronix.de \
--cc=torvalds@osdl.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