[PATCH 08/13] checkpatch: complex macros checks miss square brackets



We are missing 'simple' values which include square brackets. Refactor
to ensure we handle nesting correctly and detect these simple forms.

Signed-off-by: Andy Whitcroft <apw@xxxxxxxxxxxx>
---
scripts/checkpatch.pl | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index c479bde..54dfa2b 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2142,9 +2142,10 @@ sub process {
$dstat =~ s/\s*$//s;

# Flatten any parentheses and braces
- while ($dstat =~ s/\([^\(\)]*\)/1/) {
- }
- while ($dstat =~ s/\{[^\{\}]*\}/1/) {
+ while ($dstat =~ s/\([^\(\)]*\)/1/ ||
+ $dstat =~ s/\{[^\{\}]*\}/1/ ||
+ $dstat =~ s/\[[^\{\}]*\]/1/)
+ {
}

my $exceptions = qr{
--
1.6.0.1.451.gc8d31

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: puzzling results from dlookup
    ... Since the field name begins with a number, use square brackets around the ... Year is a VBA function, and it will confuse Access if you use it as a ... thinks is a missing operator. ... Criteria string is correctly formed. ...
    (microsoft.public.access.formscoding)
  • Re: Populating a dictionary, fast
    ... code, while correct in intent, does look a bit fishy (missing those ... By "missing those square brackets", what would be a list comprehension ... Enter 'python "generator expression"' into your favourite search ...
    (comp.lang.python)
  • Re: Populating a dictionary, fast
    ... code, while correct in intent, does look a bit fishy (missing those ... square brackets), so don't dismiss it just because you had trouble ...
    (comp.lang.python)
  • Re: Deleting a table in another MDB
    ... Rich P wrote in ... It was the square brackets that I was missing ... usenet at dfenton dot com http://www.dfenton.com/DFA/ ...
    (comp.databases.ms-access)