Re: [Libguestfs] [libnbd PATCH] api: Generate flag values as unsigned

2022-11-15 Thread Richard W.M. Jones
On Fri, Nov 11, 2022 at 11:27:51AM -0600, Eric Blake wrote: > C says that performing bitwise math on ints can lead to corner-case > undefined values. When we document something as being usable as a > flag with bitwise-OR and similar, we should ensure the values are > unsigned, to avoid those

[Libguestfs] [libnbd PATCH] api: Generate flag values as unsigned

2022-11-11 Thread Eric Blake
C says that performing bitwise math on ints can lead to corner-case undefined values. When we document something as being usable as a flag with bitwise-OR and similar, we should ensure the values are unsigned, to avoid those corner-cases in C. Even our own codebase was potentially falling foul