Today's patches

Russ Allbery eagle at eyrie.org
Sat May 9 00:48:05 UTC 2015


"Matt Seitz (matseitz)" <matseitz at cisco.com> writes:

> ISO Standard C says that if an initializer initializes some but not all
> elements, the additional elements are automatically initialized as if
> "0" was explicitly given.  This makes it nice to use "={0}" as a default
> initializer, without having to update the initializer every time the
> elements in a struct are changed.

INN doesn't take advantage of this as a matter of coding style, because
it's otherwise very easy to miss initialization sites if you add a new
element to a struct that *shouldn't* be initialized with 0.  Also because
GCC warns about this by default, and I tried to stick with GCC warnings
rather than turn them off.

I personally prefer to have to check every initialization site if I change
a struct, rather than just assuming that 0 is the right initializer.

-- 
Russ Allbery (eagle at eyrie.org)              <http://www.eyrie.org/~eagle/>

    Please send questions to the list rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.


More information about the inn-workers mailing list