public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: WANG Cong <xiyou.wangcong@gmail.com>
To: Gerhard Mack <gmack@innerfire.net>
Cc: WANG Cong <xiyou.wangcong@gmail.com>,
	Dave Haywood <tla@oak.selfip.net>,
	linux-kernel@vger.kernel.org
Subject: Re: linux 2.6.23-rc7 - 14 compile warnings
Date: Sun, 23 Sep 2007 11:14:30 +0800	[thread overview]
Message-ID: <20070923031430.GJ2475@hacking> (raw)
In-Reply-To: <alpine.DEB.0.999.0709222212050.27608@mtl.rackplans.net>

On Sat, Sep 22, 2007 at 10:23:59PM -0400, Gerhard Mack wrote:
>On Sat, 22 Sep 2007, WANG Cong wrote:
>
>> >Summary:
>> >  CC      mm/slub.o
>> >mm/slub.c: In function 'kfree':
>> >mm/slub.c:2491: warning: passing argument 3 of 'slab_free' discards
>> >qualifiers from pointer target type
>
>static void __slab_free(struct kmem_cache *s, struct page *page,
>                                        void *x, void *addr)
>but ..
>
>void kfree(const void *x)
>
>void is not the same as const void.
>					
>> >  CC      fs/autofs4/symlink.o
>> >fs/autofs4/symlink.c: In function 'autofs4_follow_link':
>> >fs/autofs4/symlink.c:18: warning: passing argument 2 of 'nd_set_link'
>> >discards qualifiers from pointer target type
>
>Once again ino->u.symlink is a const char and it's dropping the const.
>

slab_free(s, page, (void *)x, __builtin_return_address(0));
                   ^^^^^^^^^
I knew these things. But the explicit casts, such as the above one, mean
that we are intended to discard to qualifiers and I think gcc shouldn't
warn about this.

Regards.


WANG Cong


      reply	other threads:[~2007-09-23  3:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-21  9:33 linux 2.6.23-rc7 - 14 compile warnings Dave Haywood
2007-09-22  2:29 ` WANG Cong
2007-09-23  2:23   ` Gerhard Mack
2007-09-23  3:14     ` WANG Cong [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=20070923031430.GJ2475@hacking \
    --to=xiyou.wangcong@gmail.com \
    --cc=gmack@innerfire.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tla@oak.selfip.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