Re: [PATCH v2 00/27] LLVM fixes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Mar 12, 2017 at 12:04 AM, Dibyendu Majumdar
<mobile@xxxxxxxxxxxxxxx> wrote:
> On 11 March 2017 at 23:02, Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>> On Sat, Mar 11, 2017 at 2:57 PM, Dibyendu Majumdar
>> <mobile@xxxxxxxxxxxxxxx> wrote:
>>>
>>> Why the division? That seems incorrect to me.
>>
>> Pointer differences are not byte differences, but index differences.
>> So with an "int *" you need to divide the difference by 4 (you don't
>> see the subtraction, since subtracting NULL ends up being a no-op).
>>
>
> Okay that makes sense.

Yes, as Linus explained.
In fact I made the test cases to create this as I suspected some difficulties
there since it's the kind of operation that by its nature mix different types.

-- Luc
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux