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

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

Mike Klar

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

+/* // */
+ CASE('\n', start);
+ NOTCASE('\\', slash_slash);
+ goto slash_slash;
/* / */
+ CASE('/', slash_slash);
NOTCASE('*', __start);
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

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