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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 17 Dec 2013 21:39:46 -0800
From:	Joe Perches <joe@...ches.com>
To:	Jean-Baptiste Theou <jtheou@...neo-embedded.us>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] checkpatch.pl: Fix wrong curly bracket position
 reporting

On Tue, 2013-12-17 at 18:59 -0800, Jean-Baptiste Theou wrote:
> This patch fixes wrong curly bracket position reporting when function
> declarations have only one void argument.
> 
> Missing error (ERROR: space required before the open brace '{') on this
> situation :
> 
> int foo(void){
> 	...
> }

That's true for any declaration with { on the same line.

Perhaps this would be better:
---
 scripts/checkpatch.pl | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 8f3aecd..c4dbb8a 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2784,7 +2784,8 @@ sub process {
 
 # function brace can't be on same line, except for #defines of do while,
 # or if closed on same line
-		if (($line=~/$Type\s*$Ident\(.*\).*\s{/) and
+		if ($^V && $^V ge 5.10.0 &&
+		    ($line=~/$Type\s*$Ident\s*$balanced_parens\s*{\s*$/) &&
 		    !($line=~/\#\s*define.*do\s{/) and !($line=~/}/)) {
 			ERROR("OPEN_BRACE",
 			      "open brace '{' following function declarations go on the next line\n" . $herecurr);
@@ -3159,7 +3160,9 @@ sub process {
 ## 		}
 
 #need space before brace following if, while, etc
-		if (($line =~ /\(.*\){/ && $line !~ /\($Type\){/) ||
+		if ($^V && $^V ge 5.10.0 &&
+		    ($line !~ /$Type\s*$Ident\s*$balanced_parens\s*{\s*$/) &&
+		    ($line =~ /\(.*\){/ && $line !~ /\($Type\){/) ||
 		    $line =~ /do{/) {
 			if (ERROR("SPACING",
 				  "space required before the open brace '{'\n" . $herecurr) &&


--
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