linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Christopher Li" <sparse@chrisli.org>
To: Tommy Thorn <tommy@numba-tu.com>
Cc: David Given <dg@cowlark.com>, linux-sparse@vger.kernel.org
Subject: Re: [PATCH] Warn about explicit usage of sizeof(void)
Date: Thu, 25 Dec 2008 10:48:41 -0800	[thread overview]
Message-ID: <70318cbf0812251048lfe688a0j1977ea2b8161af79@mail.gmail.com> (raw)
In-Reply-To: <4953C17B.8060803@numba-tu.com>

On Thu, Dec 25, 2008 at 9:23 AM, Tommy Thorn <tommy@numba-tu.com> 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

      parent reply	other threads:[~2008-12-25 18:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-25  2:09 [PATCH] Warn about explicit usage of sizeof(void) Christopher Li
2008-12-25 17:23 ` Tommy Thorn
2008-12-25 18:36   ` [PATCH] Warn about explicit usage of sizeof(void) and sizeof(function) Alexey Zaytsev
2008-12-25 19:45     ` Christopher Li
2008-12-25 20:10       ` [PATCH] Also warn about sizeof(function) Alexey Zaytsev
2008-12-26  0:48         ` Christopher Li
2008-12-28 15:14     ` [PATCH] Null ctype should have ptr_ctype as its base type Alexey Zaytsev
2008-12-28 20:52       ` Christopher Li
2008-12-28 21:38         ` Alexey Zaytsev
2008-12-29  7:32           ` Christopher Li
2008-12-29  9:03             ` Alexey Zaytsev
2008-12-25 18:48   ` Christopher Li [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=70318cbf0812251048lfe688a0j1977ea2b8161af79@mail.gmail.com \
    --to=sparse@chrisli.org \
    --cc=dg@cowlark.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=tommy@numba-tu.com \
    /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).