On Mon, Sep 20, 2021 at 03:30:38PM +0200, Ævar Arnfjörð Bjarmason wrote: > Thus the anti-pattern, yes set defaults for some members to -1, but not > the entire struct. The only value we should memset a whole bag-of-stuff > config struct to is 0, as that's the only sensible default & plays well > with other C semantics. FWIW, I agree. I had to scratch my head for a moment at why a memset of "-1" would work at all on multi-byte types. I think it's better avoided in the name of readability and obviousness, not to mention the trap it leaves for items that don't sensibly initialize with it (like, say, pointers). As an aside, memset to 0 is _also_ undefined for pointers, but we long ago decided not to care, as no real-world systems have a problem with this. -Peff