diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h --- a/clang/include/clang-c/Index.h +++ b/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 { /**