lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1185486895.4459.3.camel@josh-work.beaverton.ibm.com>
Date:	Thu, 26 Jul 2007 14:54:55 -0700
From:	Josh Triplett <josht@...ux.vnet.ibm.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	linux-kernel@...r.kernel.org,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	linux-sparse@...r.kernel.org
Subject: Re: [PATCH] CodingStyle: proscribe do-while without braces.

On Thu, 2007-07-26 at 14:44 -0700, Andrew Morton wrote:
> On Thu, 26 Jul 2007 14:37:02 -0700 Josh Triplett <josht@...ux.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@...nel.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


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ