public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: linux-kbuild <linux-kbuild@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Cc: Mike Frysinger <vapier@gentoo.org>, Sam Ravnborg <sam@ravnborg.org>
Subject: [PATCH 08/13] headers_check.pl: disallow extern's
Date: Mon, 29 Dec 2008 14:53:18 +0100	[thread overview]
Message-ID: <1230558803-7168-8-git-send-email-sam@ravnborg.org> (raw)
In-Reply-To: <20081229134402.GA7069@uranus.ravnborg.org>

From: Mike Frysinger <vapier@gentoo.org>

Since prototypes with "extern" refer to kernel functions, they make no
sense in userspace, so reject them automatically.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
[sam: made it into a warning]
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
 scripts/headers_check.pl |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/scripts/headers_check.pl b/scripts/headers_check.pl
index 488a3b1..5bdd975 100644
--- a/scripts/headers_check.pl
+++ b/scripts/headers_check.pl
@@ -14,7 +14,9 @@
 #    Only include files located in asm* and linux* are checked.
 #    The rest are assumed to be system include files.
 #
-# 2) TODO: check for leaked CONFIG_ symbols
+# 2) It is checked that prototypes does not use "extern"
+#
+# 3) TODO: check for leaked CONFIG_ symbols
 
 use strict;
 
@@ -33,6 +35,7 @@ foreach my $file (@files) {
 	while ($line = <FH>) {
 		$lineno++;
 		check_include();
+		check_prototypes();
 	}
 	close FH;
 }
@@ -54,3 +57,10 @@ sub check_include
 		}
 	}
 }
+
+sub check_prototypes
+{
+	if ($line =~ m/^\s*extern\b/) {
+		printf STDERR "$filename:$lineno: extern's make no sense in userspace\n";
+	}
+}
-- 
1.6.0.2.GIT


  parent reply	other threads:[~2008-12-29 13:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-29 13:44 pending kbuild updates Sam Ravnborg
2008-12-29 13:53 ` [PATCH 01/13] m68k: fix recursive dependency in Kconfig Sam Ravnborg
2008-12-29 13:53 ` [PATCH 02/13] kconfig: explain symbol value defaults Sam Ravnborg
2008-12-29 13:53 ` [PATCH 03/13] kconfig: add comments to symbol flags Sam Ravnborg
2008-12-29 13:53 ` [PATCH 04/13] kconfig: struct property commented Sam Ravnborg
2008-12-29 13:53 ` [PATCH 05/13] kconfig: improve readout when we hit recursive dependencies Sam Ravnborg
2008-12-29 13:53 ` [PATCH 06/13] kconfig: print all locations when we see a recursive dependency Sam Ravnborg
2008-12-31  2:55   ` Roman Zippel
2008-12-31  9:05     ` Sam Ravnborg
2009-01-18 20:54     ` Sam Ravnborg
2008-12-29 13:53 ` [PATCH 07/13] kconfig: improve error messages for bad source statements Sam Ravnborg
2008-12-29 13:53 ` Sam Ravnborg [this message]
2008-12-29 13:53 ` [PATCH 09/13] kbuild: check for leaked CONFIG_ symbols to userspace Sam Ravnborg
2008-12-29 13:53 ` [PATCH 10/13] kbuild: in headers_install autoconvert asm/inline/volatile to __xxx__ Sam Ravnborg
2008-12-29 13:53 ` [PATCH 11/13] kbuild: disable sparse warning "returning void-valued expression" Sam Ravnborg
2008-12-29 13:53 ` [PATCH 12/13] kbuild: make *config usage docs Sam Ravnborg
2008-12-29 13:53 ` [PATCH 13/13] kbuild: document environment variables Sam Ravnborg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1230558803-7168-8-git-send-email-sam@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vapier@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox