Subject: Re: [PATCH 4/5] config.c: add a "tristate" helper

From: Junio C Hamano <[email-masked]>
Date: Thu, 08 Apr 2021 16:51:52 -0700

Ævar Arnfjörð Bjarmason <[email-masked]> writes:

> I'd prefer to just make these "enum", which means we'll have the aid of
> the compiler in checking all the callsites, as in the patch-on-top
> (which I can squash appropriately, need to update the doc comments
> though) at the end of this E-Mail.

I think enum is oversold by some people (not me).  C Compilers won't
do much when you use them interchangeably with int, simply because
they are designed to be used that way, no?

If existing code used 0 as false and 1 as true, and it learns an
"auto" value with a new definition,

    #define TRISTATE_AUTO 2

without TRISTATE_{TRUE,FALSE} defined to 0 and 1, that would be a
good place to stop.  I'd be quite happy with that.