[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d03a69ce5a06f50230700b0e94e50193@codeaurora.org>
Date: Mon, 21 Jun 2021 10:44:51 -0600
From: subashab@...eaurora.org
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: Sean Tranchetti <stranche@...eaurora.org>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH net-next] net: qualcomm: rmnet: fix two pointer math bugs
On 2021-06-21 01:18, Dan Carpenter wrote:
> On Mon, Jun 21, 2021 at 10:11:58AM +0300, Dan Carpenter wrote:
>> On Sat, Jun 19, 2021 at 01:12:09PM -0600, subashab@...eaurora.org
>> wrote:
>> > On 2021-06-19 07:52, Dan Carpenter wrote:
>> >
>> > Hi Dan
>> >
>> > Thanks for fixing this. Could you cast the ip4h to char* instead of void*.
>> > Looks like gcc might raise issues if -Wpointer-arith is used.
>> >
>> > https://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/Pointer-Arith.html#Pointer-Arith
>>
>> The fix for that is to not enable -Wpointer-arith. The warning is
>> dumb.
>
> Sorry, that was uncalled for and not correct. The GCC warning would be
> useful if we were trying to write portable userspace code. But in the
> kernel the kernel uses GCC extensions a lot.
>
> The Clang compiler can also compile the kernel these days. But it had
> to add support for a bunch of GCC extensions to make that work. Really
> most of linux userspace is written with GCC in mind so Clang had to do
> this anyway.
>
> So we will never enable -Wpointer-arith in the kernel because there is
> no need.
>
> regards,
> dan carpenter
Thanks for the clarification.
Reviewed-by: Subash Abhinov Kasiviswanathan <subashab@...eaurora.org>
Powered by blists - more mailing lists