Re: sparse preprocessing confused

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

 



Chris Wedgwood wrote:
> On Thu, Apr 26, 2007 at 11:38:52PM +0900, Neil Booth wrote:
>>>>        memcpy(data + nhead, skb->head,
>>>> #ifdef NET_SKBUFF_DATA_USES_OFFSET
>>>>                skb->tail);
>>>> #else
>>>>                skb->tail - skb->head);
>>>> #endif
>>> If memcpy happens to be a macro, that is not valid C.
>> It's undefined rather than invalid.  GCC makes an effort to
>> do "what you'd expect".
> 
> I think I prefer sparse breaking on things like this (so we can find
> such uglies and correct them.).

I tend to agree; however, if GCC accepts the code, I would prefer to have
Sparse parse it and warn, rather than failing to parse it.  I would gladly
take a clean patch that allows this code to work the same way GCC does.  Bonus
if the patch supplies a -Wpreprocessor-conditional-in-macro-arguments or
similar, and I wouldn't object to having such a warning on by default.

- Josh Triplett

Attachment: signature.asc
Description: OpenPGP digital signature


[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