Thread (19 messages) flat view 19 messages, 7 authors, 2016-06-15

Re: [PATCH 1/4] wt-status: fix possible use of uninitialized variable

From: Jeff King <hidden>
Date: 2016-06-15 22:56:29

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help