[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120120134604.GM3356@mwanda>
Date: Fri, 20 Jan 2012 16:46:04 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Joe Perches <joe@...ches.com>
Cc: Andy Whitcroft <apw@...onical.com>, linux-kernel@...r.kernel.org,
swetland@...gle.com, devel@...uxdriverproject.org,
Pradheep Shrinivasan <pradheep.sh@...il.com>
Subject: Re: [PATCH 1/6] staging:android_pmem.h: Fixes the space and other
formating issues pointed out by checkpatch.pl
On Fri, Jan 20, 2012 at 05:15:15AM -0800, Joe Perches wrote:
> @@ -2838,7 +2849,8 @@
> if ($dstat ne '' &&
> $dstat !~ /^(?:$Ident|-?$Constant),$/ && # 10, // foo(),
> $dstat !~ /^(?:$Ident|-?$Constant);$/ && # foo();
> - $dstat !~ /^(?:$Ident|-?$Constant)$/ && # 10 // foo()
> + $dstat !~ /^[!~-]?(?:$Ident|$Constant)$/ && # 10 // foo() // !foo // ~foo // -foo
> + $dstat !~ /^'X'$/ && # character constants
> $dstat !~ /$exceptions/ &&
> $dstat !~ /^\.$Ident\s*=/ && # .foo =
> $dstat !~ /^do\s*$Constant\s*while\s*$Constant;?$/ && # do {...} while (...); // do {...} while (...)
>
> I think the character change test is fine but
> the !~- addition/change is suspect.
>
> !~- are precedence level 3 operators
Level 2?
> and can be impacted by things like ++
They work like you would expect:
#define NOT_FOO !foo
++NOT_FOO <-- compile error.
NOT_FOO++ <-- works.
Anyway if people are really writing macros which are used this way,
then that's something which is outside of the scope of checkpatch.pl
to fix.
regards,
dan carpenter
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists