================
@@ -361,6 +368,13 @@ CodeGenFunction::AddInitializerToStaticVarDecl(const 
VarDecl &D,
     }
     return GV;
   }
+  if (!getLangOpts().CPlusPlus) {
+    // In C, when an initializer is given, the Linux kernel relies on clang to
+    // zero-initialize all members not explicitly initialized, including 
padding
+    // bits.
----------------
rjmccall wrote:

Also, I think we should do this unconditionally in all language modes.  It's 
not like this is forbidden in C++.

https://github.com/llvm/llvm-project/pull/97121
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to