Re: [PATCH] src: Fix return types of .stateInitialize callbacks

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

 



On 5/22/24 12:22, Daniel P. Berrangé wrote:
> On Wed, May 22, 2024 at 12:08:15PM +0200, Michal Privoznik wrote:
>> The virStateDriver struct has .stateInitialize callback which is
>> declared to return virDrvStateInitResult enum. But some drivers
>> return a plain int in their implementation which is UB.
> 
> Any idea if there's a warning flag we could potentially turn on that
> would diagnose such a mis-match ?
> 

That's a good question. Similarly, I'm surprised neither gcc nor clang
complains when a function is declared to return an enum but there's
"return -20" somewhere (and -20 is NOT in the enum definition). I
haven't found any such warning. These were spotted when trying to start
libvirtd built with UBSAN.

> 
> Reviewed-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>

Merged, thanks.

Michal




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux