[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <57F385DC0200007800114C92@prv-mh.provo.novell.com>
Date: Tue, 04 Oct 2016 02:35:08 -0600
From: "Jan Beulich" <JBeulich@...e.com>
To: "Johannes Berg" <johannes@...solutions.net>
Cc: "Ingo Molnar" <mingo@...nel.org>, <x86@...nel.org>,
"Thomas Gleixner" <tglx@...utronix.de>,
<linux-kernel@...r.kernel.org>, "H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH] x86: suppress sparse warning in copy_to_user()
>>> On 04.10.16 at 10:02, <johannes@...solutions.net> wrote:
> On Tue, 2016-10-04 at 01:51 -0600, Jan Beulich wrote:
>> >
>> > >
>> > > >
>> > > > On 04.10.16 at 09:33, <johannes@...solutions.net> wrote:
>> > From: Johannes Berg <johannes.berg@...el.com>
>> >
>> > __compiletime_object_size() is simply defined to
>> > __builtin_object_size()
>> > which gcc declares with (void *, int type) prototype.
>>
>> If that was the case, everyone should have seen such warnings from
>> the day the original patch got introduced.
>
> Only if they run sparse. Clearly people don't, or we wouldn't have a
> history of a ton of such problems, e.g.
No - you say "which gcc declares with (void *, int type) prototype".
If that was the case, there would need to be a warning.
>> And the compiler warnings
>> I get when testing with all four combinations of const and volatile
>> also supports this by saying "expected 'const void *' but ..."
>
> It's not a compiler warning though that I'm getting.
>
> What tool are you using to get such a warning?
I'm talking about gcc and the warning surfacing when I additonally
add volatile.
> On gcc 6.1.1, I'm getting no warning (from the compiler) either way,
> even with W=2, and the gcc documentation notes the fact that it treats
> it as passing void *:
>
> https://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html
Perhaps it's just the documentation which is imprecise here?
Jan
Powered by blists - more mailing lists