================
@@ -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:

Comments in the compiler generally shouldn't refer to specific projects.  We 
are making a guarantee based on our interpretation of the standard.

Similarly, the PR title is also inappropriate.  It is fine to note in the PR 
description that Linux relies on this for correctness, but the PR title should 
describe the semantic change.

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