This revision was automatically updated to reflect the committed changes.
Closed by commit rG00e52588f02e: Improve documentation of CXIndexOptions; NFC 
(authored by vedgy, committed by aaron.ballman).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145775

Files:
  clang/include/clang-c/Index.h


Index: clang/include/clang-c/Index.h
===================================================================
--- clang/include/clang-c/Index.h
+++ clang/include/clang-c/Index.h
@@ -329,8 +329,8 @@
  * Index initialization options.
  *
  * 0 is the default value of each member of this struct except for Size.
- * Initialize the struct in one of the following two ways to avoid adapting 
code
- * each time a new member is added to it:
+ * Initialize the struct in one of the following three ways to avoid adapting
+ * code each time a new member is added to it:
  * \code
  * CXIndexOptions Opts;
  * memset(&Opts, 0, sizeof(Opts));
@@ -340,6 +340,11 @@
  * \code
  * CXIndexOptions Opts = { sizeof(CXIndexOptions) };
  * \endcode
+ * or to prevent the -Wmissing-field-initializers warning for the above 
version:
+ * \code
+ * CXIndexOptions Opts{};
+ * Opts.Size = sizeof(CXIndexOptions);
+ * \endcode
  */
 typedef struct CXIndexOptions {
   /**


Index: clang/include/clang-c/Index.h
===================================================================
--- clang/include/clang-c/Index.h
+++ clang/include/clang-c/Index.h
@@ -329,8 +329,8 @@
  * Index initialization options.
  *
  * 0 is the default value of each member of this struct except for Size.
- * Initialize the struct in one of the following two ways to avoid adapting code
- * each time a new member is added to it:
+ * Initialize the struct in one of the following three ways to avoid adapting
+ * code each time a new member is added to it:
  * \code
  * CXIndexOptions Opts;
  * memset(&Opts, 0, sizeof(Opts));
@@ -340,6 +340,11 @@
  * \code
  * CXIndexOptions Opts = { sizeof(CXIndexOptions) };
  * \endcode
+ * or to prevent the -Wmissing-field-initializers warning for the above version:
+ * \code
+ * CXIndexOptions Opts{};
+ * Opts.Size = sizeof(CXIndexOptions);
+ * \endcode
  */
 typedef struct CXIndexOptions {
   /**
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to