mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Hannes Eder" <hannes@hanneseder.net>
To: "David Howells" <dhowells@redhat.com>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] CRED: fix compilation warning in function 'get_cred'
Date: Fri, 21 Nov 2008 15:54:08 +0100	[thread overview]
Message-ID: <154e089b0811210654v45126cbene22d925a1760d9e2@mail.gmail.com> (raw)
In-Reply-To: <11321.1227219571@redhat.com>

On Thu, Nov 20, 2008 at 11:19 PM, David Howells <dhowells@redhat.com> wrote:
> Hannes Eder <hannes@hanneseder.net> wrote:
>
>> Fix to following warning by introducing a temporary variable:
>>
>> include/linux/cred.h: In function 'get_cred':
>> include/linux/cred.h:187: warning: passing argument 1 of
>> 'get_new_cred' discards qualifiers from pointer target type
>
> Interesting.  I believe that's a compiler bug.  Explicitly casting away the
> const should avoid this warning.

Strange. I think you are right, looks like a compiler bug.  I am using
gcc (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu3).  Compiling the following code
snippet does not yield a spurious warning:

struct foo {
	int a;
};

static inline struct foo *bar(struct foo *foo)
{
	foo->a++;
	return foo;
}

static inline const struct foo *bar2(const struct foo *foo)
{
	return bar((struct foo*)foo);
}

What do you suggest, report this as a gcc bug?

-Hannes

  reply	other threads:[~2008-11-21 14:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-20 22:00 Hannes Eder
2008-11-20 22:19 ` David Howells
2008-11-21 14:54   ` Hannes Eder [this message]
2008-11-21 16:25   ` David Howells
2008-11-21 20:22     ` Hannes Eder
2008-11-22  0:36     ` David Howells

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=154e089b0811210654v45126cbene22d925a1760d9e2@mail.gmail.com \
    --to=hannes@hanneseder.net \
    --cc=dhowells@redhat.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®