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-next>] [day] [month] [year] [list]
Message-Id: <1332430038-21057-1-git-send-email-ext-phil.2.carmody@nokia.com>
Date:	Thu, 22 Mar 2012 17:27:18 +0200
From:	Phil Carmody <ext-phil.2.carmody@...ia.com>
To:	apw@...onical.com
Cc:	hpa@...or.com, ext-phil.2.carmody@...ia.com,
	linux-kernel@...r.kernel.org
Subject: [PATCH 1/1] checkpatch.pl: thou shalt not use () or (...) in function declarations

After HPA's wonderful lkml post, referenced, it seems worth trying to
detect this robomatically.

Signed-off-by: Phil Carmody <ext-phil.2.carmody@...ia.com>
---
 scripts/checkpatch.pl |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index a3b9782..3993011 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1881,6 +1881,10 @@ sub process {
 				substr($ctx, 0, $name_len + 1, '');
 				$ctx =~ s/\)[^\)]*$//;
 
+				if ($ctx =~ /^\s*(?:\.\.\.)?\s*$/) {
+					# HPA explains why: http://lwn.net/Articles/487493/
+					ERROR("(...) and () are not sufficiently informative function declarations\n$hereline");
+				}
 				for my $arg (split(/\s*,\s*/, $ctx)) {
 					if ($arg =~ /^(?:const\s+)?($Ident)(?:\s+$Sparse)*\s*\**\s*(:?\b$Ident)?$/s || $arg =~ /^($Ident)$/s) {
 
-- 
1.7.2.5

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