From: Josh Triplett <josh@freedesktop.org>
To: Chris Wedgwood <cw@f00f.org>
Cc: Neil Booth <neil@daikokuya.co.uk>,
Morten Welinder <mwelinder@gmail.com>,
Randy Dunlap <rdunlap@xenotime.net>,
linux-sparse@vger.kernel.org
Subject: Re: sparse preprocessing confused
Date: Sat, 28 Apr 2007 23:36:18 -0700 [thread overview]
Message-ID: <46343CE2.80403@freedesktop.org> (raw)
In-Reply-To: <20070429054143.GA15365@tuatara.stupidest.org>
[-- Attachment #1: Type: text/plain, Size: 937 bytes --]
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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
prev parent reply other threads:[~2007-04-29 6:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-25 23:43 sparse preprocessing confused Randy Dunlap
2007-04-25 23:52 ` Morten Welinder
2007-04-26 14:38 ` Neil Booth
2007-04-29 5:41 ` Chris Wedgwood
2007-04-29 6:36 ` Josh Triplett [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46343CE2.80403@freedesktop.org \
--to=josh@freedesktop.org \
--cc=cw@f00f.org \
--cc=linux-sparse@vger.kernel.org \
--cc=mwelinder@gmail.com \
--cc=neil@daikokuya.co.uk \
--cc=rdunlap@xenotime.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).