[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2] golang/xenlight: Fix type issues with recent Go version



On 28/06 18:05, George Dunlap wrote:
> On 6/28/19 9:31 AM, Nicolas Belouin wrote:
> > Newer versions of Go have become stricter on enforcing the no implicit
> > conversions policy when using CGo.
> > Specifically, the following two conversions are no longer allowed:
> > 
> > - unsafe.Pointer being automatically cast to any C pointer
> > - A pointer type other than unsafe.Pointer being automatically cast to C
> > void *
> > 
> > Fix this by adding explicit casts where necessary.
> 
> This looks good, except now the commit message is wrong: We're no longer
> simply adding casts; we're changing Context.logger from
> *C.xentoollog_logger_stdiostream to *C.xentoollog_logger.  That needs to
> be mentioned in the commit message.
> 
> I think given what you said about automatic pointer conversion
> theoretically never being OK, I might say this instead:
> 
> ---
> Theoretically Go has never allowed automatic pointer conversions; but in
> practice earlier versions let some conversions slide.  Newer compilers
> are more strict, so make sure that all pointers are converted explicitly
> the appropriate types.
> 
> Change Context.logger's type to *C.xentoollog_logger, as that's the more
> generic type, and results in fewer manual pointer conversions.
> ---
> 
> If you're OK with the above I can change it on check-in.

I'm OK with the change, thanks.

> 
> Otherwise:
> 
> Reviewed-by:  George Dunlap <george.dunlap@xxxxxxxxxx>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.