scripts/kernel-doc: parse kernel-doc deterministically
authorJérémy Bobbio <lunar@debian.org>
Wed, 8 Jul 2015 19:06:33 +0000 (20:06 +0100)
committerJonathan Corbet <corbet@lwn.net>
Fri, 10 Jul 2015 17:03:05 +0000 (11:03 -0600)
Regular expressions for highlights in kernel-doc are stored in a Perl
hash.  These hashes are ordered differently for each Perl run. This will
prevent kernel-doc to behave deterministically when parsing “@foo()” as
in some runs it will be interpreted as a parameter and in the others it
will be interpreted as a function.

We now sort the %highlights hash to get the same behavior on every run.

Signed-off-by: Jérémy Bobbio <lunar@debian.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
scripts/kernel-doc

index 9922e66883a5b763eb2b24345b9925cbe06db3c3..71ada00738055401660ebc1d96558279b53bd502 100755 (executable)
@@ -2587,7 +2587,7 @@ $kernelversion = get_kernel_version();
 
 # generate a sequence of code that will splice in highlighting information
 # using the s// operator.
-foreach my $pattern (keys %highlights) {
+foreach my $pattern (sort keys %highlights) {
 #   print STDERR "scanning pattern:$pattern, highlight:($highlights{$pattern})\n";
     $dohighlight .=  "\$contents =~ s:$pattern:$highlights{$pattern}:gs;\n";
 }
This page took 0.042254 seconds and 5 git commands to generate.