* __builtin_types_compatible_p() is too accepting
@ 2021-11-03 13:36 Dan Carpenter
2021-11-08 11:48 ` Dan Carpenter
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2021-11-03 13:36 UTC (permalink / raw)
To: linux-sparse
The kunmap_atomic() has a BUILD_BUG_ON(__same_type((__addr), struct page *))
which does __builtin_types_compatible_p(typeof(a), typeof(b)).
The problem is that Sparse considers "void *" compatible with
"struct page *" so the BUILD_BUG_ON() triggers but GCC says they are not
compatible (which is the desired behavior for the kernel).
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: __builtin_types_compatible_p() is too accepting
2021-11-03 13:36 __builtin_types_compatible_p() is too accepting Dan Carpenter
@ 2021-11-08 11:48 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2021-11-08 11:48 UTC (permalink / raw)
To: linux-sparse
n Wed, Nov 03, 2021 at 04:36:00PM +0300, Dan Carpenter wrote:
> The kunmap_atomic() has a BUILD_BUG_ON(__same_type((__addr), struct page *))
> which does __builtin_types_compatible_p(typeof(a), typeof(b)).
>
> The problem is that Sparse considers "void *" compatible with
> "struct page *" so the BUILD_BUG_ON() triggers but GCC says they are not
> compatible (which is the desired behavior for the kernel).
Sorry, this was a bug in Smatch, not Sparse.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-11-08 11:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-03 13:36 __builtin_types_compatible_p() is too accepting Dan Carpenter
2021-11-08 11:48 ` Dan Carpenter
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).