Re: [PATCH v3 02/14] odb: fix flags parameter to be unsigned
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Jan 22, 2026, 23:44 UTC
- Message-ID
- <aXK2awZo/d9bUjPY@nand.local>
- In-Reply-To
- <aXHI0vNArKiDCL-I@pks.im>
On Thu, Jan 22, 2026 at 07:50:58AM +0100, Patrick Steinhardt wrote:
Show 11 quoted lines
> > You can find this pattern in lots of places (try grepping for "enum > > [a-z_]* flag"). The ones that aren't are typically using flags that are > > not using enums at all (just #defines). > > True, but `unsigned flags` is way more common: > > $ git grep 'unsigned flags' | wc -l > 219 > > $ git grep 'enum [a-z_]* flag' | wc -l > 56
Sure, though I think the convention can/should evolve where it makes sense. I tend to agree with Peff earlier in this thread that enum flags are preferable to unsigned ones for the reasons he laid out. I don't think we should go and proactively convert the 219 instances of "unsigned flags", but for new code I think we should prefer enum flags.
Thanks, Taylor