Sinitax added a comment.

> Why do you make this a new warning group instead of just adding it to 
> -Wuninitialized?

I think a separate group is best, since the warning emits false positives: an 
intentional empty-initialization (such as `char buf[BUF_SIZ] = { 0 }`) is 
indistinguishable from unintentionally incomplete initialization (such as `int 
pair[2] = { ENUM_A /*, ENUM_B */ }`).

For this reason users would want to selectively enable it..

  #pragma clang diagnostic push
  #pragma clang diagnostic warning "-Wincomplete-initializer-list"
  
  const char *errmsg[ERR_COUNT] = {
      [ERR_A] = "error a",
  };
  
  #pragma clang diagnostic pop

.. but I'm not really satisfied with this solution. Feedback on how to 
differentiate between the aforementioned cases, if possible, is appreciated.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152083/new/

https://reviews.llvm.org/D152083

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

Reply via email to