Re: [PATCH] Warn about explicit usage of sizeof(void)

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

 



On Thu, Dec 25, 2008 at 9:23 AM, Tommy Thorn <tommy@xxxxxxxxxxxx> wrote:
> Christopher Li wrote:
>>
>> So here is what I got. A patch address both of our need. It gives warning
>> of using sizeof(void) explicitly. void* + offset will continue to work
>> without
>> warnings. It will also make is_byte_type() continue to work as it was
>> before.
>>
>> Here is my test script:
>>
>> void *p;
>>
>> int i = sizeof(void);
>> int j = sizeof(*p);
>>
>
> I can't test it right now, but does it give a warning for both sizeof's
> above? If just first results in a warning, then I think that quite
> reasonable.

It warn for both. They are the same thing. It will be strange warn one
not the other.

But my test run shows that none of the kernel code actually use
sizeof(*p). If they do, I think it desert a warning.

Thanks

Chris
--
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