mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-24 12:09:58 +00:00
b94e809d3e
In checkpatch we attempt to check for and warn about
block comments which start with /* or /** followed by a
non-blank. Unfortunately a bug in the regex meant that
we would incorrectly warn about comments starting with
"/**" with no following text:
git show 9813dc6ac3954d58ba16b3920556f106f97e1c67|./scripts/checkpatch.pl -
WARNING: Block comments use a leading /* on a separate line
#34: FILE: tests/libqtest.h:233:
+/**
The sequence "/\*\*?" was intended to match either "/*" or "/**",
but Perl's semantics for '?' allow it to backtrack and try the
"matches 0 chars" option if the "matches 1 char" choice leads to
a failure of the rest of the regex to match. Switch to "/\*\*?+"
which uses what perlre(1) calls the "possessive" quantifier form:
this means that if it matches the "/**" string it will not later
backtrack to matching just the "/*" prefix.
The other end of the regex is also wrong: it is attempting
to check for "/* or /** followed by something that isn't
just whitespace", but [ \t]*.+[ \t]* will match on pure
whitespace. This is less significant but means that a line
with just a comment-starter followed by trailing whitespace
will generate an incorrect warning about block comment style
as well as the correct error about trailing whitespace which
a different checkpatch test emits.
Fixes:
|
||
---|---|---|
.. | ||
coccinelle | ||
kvm | ||
modules | ||
qapi | ||
qemu-guest-agent | ||
qemugdb | ||
qmp | ||
tracetool | ||
travis | ||
analyse-9p-simpletrace.py | ||
analyse-locks-simpletrace.py | ||
analyze-inclusions | ||
analyze-migration.py | ||
archive-source.sh | ||
checkpatch.pl | ||
clean-header-guards.pl | ||
clean-includes | ||
cleanup-trace-events.pl | ||
cocci-macro-file.h | ||
coverity-model.c | ||
create_config | ||
decodetree.py | ||
device-crash-test | ||
disas-objdump.pl | ||
dump-guest-memory.py | ||
extract-vsssdk-headers | ||
feature_to_c.sh | ||
fix-multiline-comments.sh | ||
get_maintainer.pl | ||
git-submodule.sh | ||
git.orderfile | ||
hxtool | ||
make_device_config.sh | ||
make-release | ||
qapi-gen.py | ||
qemu-binfmt-conf.sh | ||
qemu-gdb.py | ||
qemu.py | ||
qtest.py | ||
refresh-pxe-roms.sh | ||
replay-dump.py | ||
shaderinclude.pl | ||
show-fixed-bugs.sh | ||
signrom.py | ||
simpletrace.py | ||
switch-timer-api | ||
tap-driver.pl | ||
tap-merge.pl | ||
texi2pod.pl | ||
tracetool.py | ||
update-linux-headers.sh | ||
vmstate-static-checker.py |