Re: Indent and the Linux Kernel

david ingamells <[email protected]>
Newsgroups gmane.comp.gnu.indent.bugs
Message-ID <[email protected]>
J.R. Mauro wrote:
> Hello,
>
> The Linux kernel has a script called 'Lindent' which is a wrapper
> around indent. It passes indent the following options: -npro -kr -i8
> -ts8 -sob -l80 -ss -ncs -cp1, and for certain indent versions, -il0 as
> well. I've been cleaning up some kernel code lately and I noticed a
> problem with Lindent's suggestion about certain function prototypes.
> Linux uses the sparse tool to do semantic analysis, but also to check
> for proper usage of address spaces for pointers. The kernel defines
> several macros, such as __user and __iomem. These define either to a
> gcc __attibute__ macro or to nothing; they also act as a clue to
> sparse as to what kind of pointer is being passed.
>
> Now my problem is that indent as invoked by the Lindent script doesn't
> understand this odd convention. When it sees something like fun(void
> __iomem *ptr), it seems to think I'm multiplying or something and
> tells me to change this to fun(void __iomem * ptr). Is there a way for
> indent to understand that __iomem, __user, etc. are specifiers that it
> should ignore? I didn't see anything immediately useful in the man
> page.
>
> Thanks,
> ~J.R.
>
>
> _______________________________________________
> bug-indent mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/bug-indent
>
>
>   
You could try the -t option, although in conjunction with that void I'm
not sure what will happen.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.