Re: [PATCH v2 09/18] unpack-trees: add a new update_sparsity() function
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 23, 2020, 20:24 UTC
- Message-ID
- <xmqqo8sm4y6w.fsf@gitster.c.googlers.com>
- In-Reply-To
- <5a83259e-af03-1930-a62b-75ad37b05f37@gmail.com>
Derrick Stolee <stolee@gmail.com> writes:
Show 11 quoted lines
>>>> +int update_sparsity(struct unpack_trees_options *options); >>>> + >>> >>> This appears to not use the enum as it should. >> >> Whoops! Will fix. (Interesting that the compiler didn't flag any >> kind of warning based on mismatch of declared function return types >> for update_sparsity() in the .c and .h files...) > > *shrug* enums are essentially decoration over an int, so I'm not > surprised it can happen.
;-)
Yeah, the value of preferring enum over preprocessor macros because it helps debuggers to show symbolic constants, is oversold, I think. Types of variables and functions' return values need to be set to the enum or the benefit won't come to us X-<.