lkml.org 
[lkml]   [2008]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Possible false positive in checkpatch
From
Date
Alan Stern <stern@rowland.harvard.edu> writes:

> ERROR: space prohibited after that '*' (ctx:BxW)


> Certainly this is a rather uncommon code construction, but similar
> ones might occur elsewhere. To my eyes,
>
> (* (type *) ptr)
>
> looks better than
>
> (*(type *) ptr)
>
> or
>
> (*(type *)ptr)
>
> or even
>
> (*(type*)ptr)
>
> but of course this is a matter of opinion. Is there any strong feeling
> about this in the kernel community?

I think checkpatch already has gone way too far with this (and not
only this).

"type *var" vs "type* var" - sure, the latter is worse and provokes
"type* var1, var2", but anything else is IMHO only annoying and,
actually, not important WRT readability at all.

For example I prefer "type* func()" - as it's a function returning
"a pointer to type" and not "a pointer to a function returning type"
(which "type *func()" may suggest). Yes, func is not a pointer, so why
write "*" next to it?
--
Krzysztof Halasa


\
 
 \ /
  Last update: 2008-08-12 17:31    [W:0.098 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site