[PATCH] D145775: Improve documentation of CXIndexOptions; NFC

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 10 06:22:26 PST 2023


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 {
   /**


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145775.504128.patch
Type: text/x-patch
Size: 943 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230310/e1d7329f/attachment-0001.bin>


More information about the cfe-commits mailing list