lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 21 Nov 2008 15:54:08 +0100
From:	"Hannes Eder" <hannes@...neseder.net>
To:	"David Howells" <dhowells@...hat.com>
Cc:	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] CRED: fix compilation warning in function 'get_cred'

On Thu, Nov 20, 2008 at 11:19 PM, David Howells <dhowells@...hat.com> wrote:
> Hannes Eder <hannes@...neseder.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ