News for hackers. Stuff that matters.
Re:How to C in 2016 by gvb on Friday January 08, 2016 @11:05AM (#10865813)
It does if your target system properly zeros bss because, by the rules, array[10] will be placed in bss and bss is zeroed. If you replace the initializer with {1}, you force the compiler to file to a different rule that forces the compiler to explicitly initialize everything to 1.

The problem I've had (and you probably are referring to) is embedded systems that may not properly zero bss. I've also had problems in embedded systems trying to place "array[10] = {0};" into a specific non-bss section (that was really annoying).

In my experience, TFA is good practices generally, but will have problems in corner cases that you run into in deeply embedded systems.

Re:How to C in 2016 by heinrich5991 on Friday January 08, 2016 @11:37AM (#10866093)
This is incorrect, `int array[10] = {1}` initializes all but the first element with 0.