Re: [kvm-unit-tests PATCH v3 1/6] lib: s390x: introduce bitfield for PSW mask

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

 



On Wed, 07 Jun 2023 17:56:13 +0200
Nico Boehr <nrb@xxxxxxxxxxxxx> wrote:

> Quoting Janosch Frank (2023-06-01 09:42:48)
> [...]
> > I've come to like static asserts for huge structs and bitfields since 
> > they can safe you from a *lot* of headaches.  
> 
> I generally agree and I add a _Static_assert but I want to mention the
> usefulness is a bit limited in this case, since we have a bitfield inside a
> union. So it only really helps if you manage to exceed the size of mask.

better than nothing :)

if the struct becomes too big, the assert will catch it

> 
> There really is no way around the stuff I put in the selftests.
> 
> I could of course try to make that code _Static_asserts but it will not be
> pretty.

I think just a couple of asserts to make sure things aren't __too__
crazy would be good enough



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux