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: <trinity-17181830-7fff-46ae-9d8d-939646858f15-1446394811425@3capp-webde-bap36>
Date:	Sun, 1 Nov 2015 17:20:11 +0100
From:	conchur@....de
To:	linux-kernel@...r.kernel.org
Cc:	"Jonathan Corbet" <corbet@....net>,
	"Ben Hutchings" <ben@...adent.org.uk>,
	"Andrew Morton" <akpm@...ux-foundation.org>,
	"Randy Dunlap" <rdunlap@...radead.org>,
	"Danilo Cesar Lemes de Paula" <danilo.cesar@...labora.co.uk>,
	"Jérémy Bobbio" <lunar@...ian.org>,
	"Johannes Berg" <johannes.berg@...el.com>,
	"Bart Van Assche" <bart.vanassche@...disk.com>
Subject: kernel-doc: Not stripped #define/#ifdef/#endif in enums

Hi,
 
just noticed that #define in kernel-doc are not correctly stripped anymore from enums. Here is my patch

 
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1830,7 +1830,7 @@ sub dump_enum($$) {
     my $file = shift;
 
     $x =~ s@/\*.*?\*/@@gos;	# strip comments.
-    $x =~ s/^#\s*define\s+.*$//; # strip #define macros inside enums
+    $x =~ s@#\s*define\s+[^;]*;@@gos; # strip #define macros inside enums
 
     if ($x =~ /enum\s+(\w+)\s*{(.*)}/) {
 	$declaration_name = $1;

 
But there are also places in the kernel where #ifdef/#endif is used inside enums. So maybe this should also be stripped:

--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1830,7 +1830,8 @@ sub dump_enum($$) {
     my $file = shift;
 
     $x =~ s@/\*.*?\*/@@gos;	# strip comments.
-    $x =~ s/^#\s*define\s+.*$//; # strip #define macros inside enums
+    # strip #define/#ifdef/#endif macros inside enums
+    $x =~ s@#\s*((define|ifdef)\s+|endif)[^;]*;@@gos;
 
     if ($x =~ /enum\s+(\w+)\s*{(.*)}/) {
 	$declaration_name = $1;

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