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.
Showing the changes to scripts/kernel-doc (1 of 1 file). Show all
Unified · Split
| @@ -2587,7 +2587,7 @@ $kernelversion = get_kernel_version(); · 2586 unmodified lines | ||
| 2587 | 2587 | |
| 2588 | 2588 | # generate a sequence of code that will splice in highlighting information |
| 2589 | 2589 | # using the s// operator. |
| 2590 | −foreach my $pattern (keys %highlights) { | |
| 2590 | +foreach my $pattern (sort keys %highlights) { | |
| 2591 | 2591 | # print STDERR "scanning pattern:$pattern, highlight:($highlights{$pattern})\n"; |
| 2592 | 2592 | $dohighlight .= "\$contents =~ s:$pattern:$highlights{$pattern}:gs;\n"; |
| 2593 | 2593 | } |