ilya-biryukov added a comment.

In https://reviews.llvm.org/D43230#1006104, @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 
code?


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D43230



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to