Cleanup: quiet clang's missing-variable-declarations warning in RNA

Clang's missing-variable-declarations is useful to set as an error
when variables aren't declared as static when they should be.

C++ support for RNA files [0] caused clang to print many
missing-variable-declarations warnings (which I set to error locally).
This change suppresses the warning for RNA.

This should be resolved but for now suppress the RNA warning so this
can be treated as an error elsewhere.

[0]: d154ebfa83
This commit is contained in:
Campbell Barton
2023-07-05 13:02:38 +10:00
parent 81f2eb3eeb
commit a4583f1cb8

View File

@@ -4706,6 +4706,12 @@ static void rna_generate(BlenderRNA *brna, FILE *f, const char *filename, const
fprintf(f, "#pragma GCC diagnostic ignored \"-Wunused-parameter\"\n\n");
#endif
#if defined(__clang__)
/* TODO(@ideasman42): ideally this workaround would not be needed,
* could use some further investigation as these are intended to be declared. */
fprintf(f, "#pragma GCC diagnostic ignored \"-Wmissing-variable-declarations\"\n\n");
#endif
fprintf(f, "/* Auto-generated Functions. */\n\n");
for (ds = DefRNA.structs.first; ds; ds = ds->cont.next) {