lkml.org 
[lkml]   [2020]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kvm/emulate: fix a -Werror=cast-function-type
On Fri, Feb 14, 2020 at 08:33:50PM +0100, Paolo Bonzini wrote:
> On 14/02/20 20:14, Qian Cai wrote:
> >> It seems misguided to define a local variable just to get an implicit
> >> cast from (void *) to (fastop_t). Sean's first suggestion gives you
> >> the same implicit cast without the local variable. The second
> >> suggestion makes both casts explicit.
> >
> > OK, I'll do a v2 using the first suggestion which looks simpler once it passed
> > compilations.
> >
>
> Another interesting possibility is to use an unnamed union of a
> (*execute) function pointer and a (*fastop) function pointer.

I considered that when introducing fastop_t. I don't remember why I
didn't go that route. It's entirely possible I completely forgot that
anonymous unions are allowed and thought it would mean changing a bunch
of use sites.

\
 
 \ /
  Last update: 2020-02-14 20:55    [W:0.064 / U:10.620 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site