login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2007
»
July
»
26
Re: [PATCH] CodingStyle: proscribe do-while without braces.
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
[view in full thread]
From:
Josh Triplett <josht@...>
To: Andrew Morton <akpm@...>
Cc: <linux-kernel@...>, Linus Torvalds <torvalds@...>, <linux-sparse@...>
Subject:
Re: [PATCH] CodingStyle: proscribe do-while without braces.
Date: Thursday, July 26, 2007 - 5:54 pm
On Thu, 2007-07-26 at 14:44 -0700, Andrew Morton wrote:
quoted text
> On Thu, 26 Jul 2007 14:37:02 -0700 Josh Triplett <josht@linux.vnet.ibm.com> wrote: > > > Sparse warns about do-while loops without braces; Linus's rationale from the > > Sparse Git changelog: > > > Add warning message for naked do-while > > > > > > Does it necessarily make sense? Dunno, but it does tend to be bad > > > practice, or at least result in code that can be hard to mentally parse. > > > > > > Maybe that mental parsing is just me. Or maybe it should be warned > > > about. You decide. > > > > Signed-off-by: Josh Triplett <josh@kernel.org> > > --- > > Documentation/CodingStyle | 7 +++++++ > > 1 files changed, 7 insertions(+), 0 deletions(-) > > > > diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle > > index 7f1730f..f12e4b8 100644 > > --- a/Documentation/CodingStyle > > +++ b/Documentation/CodingStyle > > @@ -175,6 +175,13 @@ if (condition) { > > otherwise(); > > } > > > > +This also does not apply to a do-while loop; always use braces with a do-while, > > +even if it contains a single statement: > > + > > +do { > > + this(); > > +} while(condition); > > + > > err, your example has broken coding style.
Oops; thanks for catching that. :) - Josh Triplett -
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
Messages in current thread:
[PATCH] CodingStyle: proscribe do-while without braces.
, Josh Triplett
, (Thu Jul 26, 5:37 pm)
Re: [PATCH] CodingStyle: proscribe do-while without braces.
, Krzysztof Halasa
, (Thu Jul 26, 8:18 pm)
Re: [PATCH] CodingStyle: proscribe do-while without braces.
, Stefan Richter
, (Thu Jul 26, 8:42 pm)
Re: [PATCH] CodingStyle: proscribe do-while without braces.
, Randy Dunlap
, (Thu Jul 26, 9:17 pm)
Re: [PATCH] CodingStyle: proscribe do-while without braces.
, Andrew Morton
, (Thu Jul 26, 8:59 pm)
Re: [PATCH] CodingStyle: proscribe do-while without braces.
, Stefan Richter
, (Fri Jul 27, 3:41 am)
Re: [PATCH] CodingStyle: proscribe do-while without braces.
, Andrew Morton
, (Fri Jul 27, 3:53 am)
Re: [PATCH] CodingStyle: proscribe do-while without braces.
, Stefan Richter
, (Fri Jul 27, 1:13 pm)
Re: [PATCH] CodingStyle: proscribe do-while without braces.
, Andrew Morton
, (Thu Jul 26, 8:35 pm)
Re: [PATCH] CodingStyle: proscribe do-while without braces.
, Krzysztof Halasa
, (Fri Jul 27, 12:00 pm)
Re: [PATCH] CodingStyle: proscribe do-while without braces.
, Josh Triplett
, (Fri Jul 27, 1:05 pm)
Re: [PATCH] CodingStyle: proscribe do-while without braces.
, Andrew Morton
, (Fri Jul 27, 2:27 pm)
Re: [PATCH] CodingStyle: proscribe do-while without braces.
, Josh Triplett
, (Fri Jul 27, 2:52 pm)
Re: [PATCH] CodingStyle: proscribe do-while without braces.
, Krzysztof Halasa
, (Fri Jul 27, 1:44 pm)
Re: [PATCH] CodingStyle: proscribe do-while without braces.
, Andrew Morton
, (Thu Jul 26, 5:44 pm)
Re: [PATCH] CodingStyle: proscribe do-while without braces.
, Josh Triplett
, (Thu Jul 26, 5:54 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
David Miller
Re: Slow DOWN, please!!!
Greg Kroah-Hartman
[PATCH 013/196] Documentation: Replace obsolete "driverfs" with "sysfs".
James Bottomley
Re: Integration of SCST in the mainstream Linux kernel
Jeff Garzik
Re: [RFC] Heads up on sys_fallocate()
git
:
linux-netdev
:
Jarek Poplawski
[PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
Gerrit Renker
[PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side)
Linus Torvalds
Re: [GIT]: Networking
Andrew Morton
Re: [BUG] New Kernel Bugs
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
1 user
and
473 guests
online.
Online users
tanggana93
Syndicate