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: <46169968.2050006@s5r6.in-berlin.de>
Date:	Fri, 06 Apr 2007 21:03:04 +0200
From:	Stefan Richter <stefanr@...6.in-berlin.de>
To:	David Brownell <david-b@...bell.net>
CC:	Jan Engelhardt <jengelh@...ux01.gwdg.de>,
	Randy Dunlap <randy.dunlap@...cle.com>,
	Tony Lindgren <tony@...mide.com>, linux-kernel@...r.kernel.org,
	David Brownell <dbrownell@...rs.sourceforge.net>
Subject: Re: coding style for long conditions (WAS: Re: [PATCH 25/90] ...
 blinky leds!!)

David Brownell wrote:
[...]
>>> 1	if (To control chain reactions, your odds
>>> 2			Improve if you've got cadmium rods) {
>>> 3		In your fission reactor
>>> 4		Their lack is a factor
>>> 5	}
>>> 6	In screams of "A meltdown! Ye gods!"
>>>
>>> Now, the former makes it hard to tell what's condition vs consequent.
>>> (Or whatever the correct technical term is in cases like these.)
>> My fu dictates that continuation lines (line 2 in this example)
>> should have more indent than line 1, 
> 
> Yes.  Where "indent" is measured -- always!! -- in tabs.
> Documentation/Coding style is quite explicit on that point:
> 
> 	Outside of comments, documentation and except in Kconfig,
> 	spaces are never used for indentation ...

I usually indent this way if expressions exceed the 80 columns limit:

	if (foo___________ &&
	    bar___________) {
		doit;
	}
and
	if ((one___________ ||
	     one_and_a_half) &&
	    two___________) {
		doit;
	}
and
	call(abc_______,
	     def___);
and

static int definition(abc_______,
		      def___)
{
...

and I know I'm not the only one.  Yes, this means I indent with tabs and
spaces --- if I wrap within expressions or within lists of function
arguments.  Of course there are always leading tabs before spaces, never
leading spaces.

PS:  Everyone please try to avoid blowing CodingStyle up to a 200 pages
document.  Thanks.
-- 
Stefan Richter
-=====-=-=== -=-- --==-
http://arcgraph.de/sr/
-
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