ilya-biryukov added a comment.

In, @ioeric wrote:

> But I think it's safe and probably easier to rely on default values of 
> primitive types like int, bool etc

It's not always safe, as primitive types are sometimes left uninitialized (e.g. 
when constructed on the stack) and reading an uninitialized value is UB.

> but do we really want to make this a requirement for future changes or even 
> in our coding style?

I think we should, default values are less surprising than UB. Other people may 
disagree, though. 
@sammccall , @hokein , WDYT? Should we always initialize primitive types in our 

  rCTE Clang Tools Extra

cfe-commits mailing list

Reply via email to