On Thu, Mar 21, 2013 at 12:49:50PM -0700, Jonathan Nieder wrote:
quoted
We could also convert the flag to an enum, which would
provide a compile-time check on the function input.
Unfortunately C permits out-of-bounds values for enums.
True, although I would think that most compilers take the hint for
switch() statements that handling all defined constants for an enum is
enough (certainly gcc does it with the "some enum constants not handled"
warning, but I did not actually check whether it does so in the
uninitialized-warning control flow checker).
Still, I'm happy enough with the die("BUG") that I posted, so we don't
need to worry about it.
-Peff