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:
Andrew Morton <akpm@...>
To: Josh Triplett <josht@...>
Cc: <linux-kernel@...>, Linus Torvalds <torvalds@...>, <linux-sparse@...>
Subject:
Re: [PATCH] CodingStyle: proscribe do-while without braces.
Date: Thursday, July 26, 2007 - 5:44 pm
On Thu, 26 Jul 2007 14:37:02 -0700 Josh Triplett <josht@linux.vnet.ibm.com> wrote:
quoted text
> 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. -
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
:
Sunil Naidu
Re: Linux 2.6.20-rc6
Alan Cox
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
Chris Snook
Re: init's children list is long and slows reaping children.
Greg Kroah-Hartman
[PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO
git
:
openbsd-misc
:
linux-netdev
:
Jarek Poplawski
[PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
David Miller
[GIT]: Networking
Gerrit Renker
[PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side)
Eric W. Biederman
Re: [PATCH 10/11] avoid kobject name conflict with different namespaces
Colocation donated by:
Who's online
There are currently
1 user
and
858 guests
online.
Online users
strcmp
Syndicate