[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2fd265ec46a8b582b7c5dea9524185b6fe1b0322.camel@sipsolutions.net>
Date: Thu, 24 Feb 2022 11:31:12 +0100
From: Johannes Berg <johannes@...solutions.net>
To: Kalle Valo <kvalo@...nel.org>,
Dan Carpenter <dan.carpenter@...cle.com>
Cc: Francesco Magliocca <franciman12@...il.com>,
Jeff Johnson <quic_jjohnson@...cinc.com>,
ath10k@...ts.infradead.org, rmanohar@....qualcomm.com,
linux-wireless@...r.kernel.org, linux-kernel@...r.kernel.org,
Linus Torvalds <torvalds@...uxfoundation.org>
Subject: Re: Use of void pointer arithmetic?
On Thu, 2022-02-24 at 11:59 +0200, Kalle Valo wrote:
>
> A good question. I have always just thought we should avoid void pointer
> arithmetic due to the C standard, but now that you mention it void
> pointers can indeed simplify the code. So I'm not so sure anymore.
>
> Any opinions? Is there a kernel wide recommendation for this?
The kernel only enables it with W=3, which I guess nobody uses anyway
... Originally it came from commit 4a5838ad9d2d ("kbuild: Add extra gcc
checks") with a pointer to
http://marc.info/?l=kernel-janitors&m=129802065918147&w=2
(which is offline right now due to an expired certificate ...)
but setting back my clock it seems to point to
https://lore.kernel.org/all/20110218091716.GA4384@bicker/
but the thread kind of revolves around -Wconversion.
FreeBSD does enable -Wpointer-arith which is why we've been trying to
keep iwlwifi clean as a courtesy to them, but for really Linux-only code
I dunno if there's much point. Although of course that applies also to
FreeBSD ...
johannes
Powered by blists - more mailing lists