lkml.org 
[lkml]   [2010]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] headers_check: better search for functions in headers
Date
Some headers don't bother with "extern" in function prototypes,
which results in said prototypes being unnoticed and exported
to userland.

This patch slightly improves detection of such cases by checking
for C type names as well in the beginning of a line.

Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
CC: Stephen Hemminger <shemminger@vyatta.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Michal Marek <mmarek@suse.cz>
CC: WANG Cong <amwang@redhat.com>
CC: linux-kernel@vger.kernel.org
---
scripts/headers_check.pl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/headers_check.pl b/scripts/headers_check.pl
index 50d6cfd..e0e25a1 100644
--- a/scripts/headers_check.pl
+++ b/scripts/headers_check.pl
@@ -64,7 +64,7 @@ sub check_include

sub check_declarations
{
- if ($line =~m/^\s*extern\b/) {
+ if ($line =~m/^(\s*extern|unsigned|char|short|int|long|void)\b/) {
printf STDERR "$filename:$lineno: " .
"userspace cannot call function or variable " .
"defined in the kernel\n";
--
1.7.2.1.45.gb66c2


\
 
 \ /
  Last update: 2010-11-30 17:25    [W:0.042 / U:0.952 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site