Messages in this thread | | | Subject | Re: [PATCH 1/1] checkpatch.pl: thou shalt not use () or (...) in function declarations | From | Joe Perches <> | Date | Thu, 22 Mar 2012 09:33:33 -0700 |
| |
On Thu, 2012-03-22 at 16:49 +0100, richard -rw- weinberger wrote: > On Thu, Mar 22, 2012 at 4:27 PM, Phil Carmody > <ext-phil.2.carmody@nokia.com> wrote: > > After HPA's wonderful lkml post, referenced, it seems worth trying to > > detect this robomatically. > > See: > http://marc.info/?l=linux-kernel&m=133193918813599
But Phil's test is better because it also tests for function declarations on multiple lines like
type foo(...)
if ($ctx =~ /((\b$Type\s+$Ident)\s*\(\s*(?:\.\.\.)?\s*\))/) {
The ERROR needs updating for a --ignore type though. Something like this may be better.
ERROR("FUNCTION_NO_PROTOTYPE", "Bad function definition - $1 should probably be $2(void)\n" . herecurr);
And I think the screed funny once but not useful.
| |