[PATCH] Fixing warnings revealed by gcc release build

Edwin Vane edwin.vane at intel.com
Tue Jan 29 09:33:20 PST 2013



================
Comment at: lib/Basic/LangOptions.cpp:17-21
@@ -16,3 +16,7 @@
 
-const SanitizerOptions SanitizerOptions::Disabled = {};
+const SanitizerOptions SanitizerOptions::Disabled = {
+#define SANITIZER(NAME, ID) 0,
+#include "clang/Basic/Sanitizers.def"
+};
+
 
----------------
Dmitri Gribenko wrote:
> David Blaikie wrote:
> > Not sure of the motivation for this change - shouldn't the {} in the original code produce the same effect (zero initializing all the elements)?
> I have mixed feelings about this.  -Wmissing-field-initializers is a different thing: all members are initialized by {}, but gcc complains that initializers are not explicitly spelled in the source.
Is it a problem to explicitly do the initialization to make gcc happy if it has the same result as {}? I wasn't aware empty braces was defined to cause all fields to be initialized to 0.


http://llvm-reviews.chandlerc.com/D342



More information about the cfe-commits mailing list