lkml.org 
[lkml]   [2000]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] mkdep mishandles apostrophes in // comments
Date
Hi,

I ran into a problem with my own kernel source files in the Linux VR project
where 'make dep' was missing CONFIG_* dependencies for some files with C++
style comments. It turns out that mkdep doesn't check for // at all, so it
will misinterpret apostrophes in those comments as single quotes and ignore
the rest of the file up to the next single quote.

I realize some people don't much like C++ style comments in the kernel
source, but a quick grep shows them all over the place, some of which do
have apostrophes not used as quotes. Anyway, the following patch (partly
from Pavel Machek) appears to fix the problem. This is against current 2.4
kernel.

Mike Klar

Index: scripts/mkdep.c
===================================================================
RCS file: /cvsroot/linux-vr/linux/scripts/mkdep.c,v
retrieving revision 1.1.1.5
diff -u -d -r1.1.1.5 mkdep.c
--- scripts/mkdep.c 2000/07/12 08:43:00 1.1.1.5
+++ scripts/mkdep.c 2000/09/23 21:07:44
@@ -294,6 +294,7 @@
* The state machine looks for (approximately) these Perl regular
expressions:
*
* m|\/\*.*?\*\/|
+ * m|\/\/.*|
* m|'.*?'|
* m|".*?"|
* m|#\s*include\s*"(.*?)"|
@@ -326,9 +327,18 @@
CASE('C', cee);
goto start;

+/* // */
+slash_slash:
+ GETNEXT
+ CASE('\n', start);
+ NOTCASE('\\', slash_slash);
+ GETNEXT
+ goto slash_slash;
+
/* / */
slash:
GETNEXT
+ CASE('/', slash_slash);
NOTCASE('*', __start);
slash_star_dot_star:
GETNEXT
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:39    [W:0.028 / U:4.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site