vedgy added inline comments.
================
Comment at: clang/tools/c-index-test/c-index-test.c:79
+ Opts.PreambleStoragePath = NULL;
+ Opts.InvocationEmissionPath =
getenv("CINDEXTEST_INVOCATION_EMISSION_PATH");
+
----------------
When a libclang user needs to override a single option in `CXIndexOptions`,
[s]he has to set every member of the struct explicitly. When new options are
added, each libclang user needs to update the code that sets the options under
`CINDEX_VERSION_MINOR` `#if`s. Accidentally omitting even one member assignment
risks undefined or wrong behavior. How about adding an `inline` helper function
`CXIndexOptions clang_getDefaultIndexOptions()`, which assigns default values
to all struct members? Libclang users can then call this function to obtain the
default configuration, then tweak only the members they want to override.
If this suggestion is to be implemented, how to deal with
[[https://stackoverflow.com/questions/68004269/differences-of-the-inline-keyword-in-c-and-c|the
differences of the inline keyword in C and C++]]?
================
Comment at: clang/tools/c-index-test/c-index-test.c:2079
+ if (!Idx)
+ return -1;
----------------
Not sure `-1` is the right value to return here. This return value becomes the
exit code of the `c-index-test` executable.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D143418/new/
https://reviews.llvm.org/D143418
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits