[llvm] [libc] [libc] default enable -ftrivial-auto-var-init=pattern (PR #78776)

Nick Desaulniers via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 19 12:49:34 PST 2024


nickdesaulniers wrote:

```diff
diff --git a/libc/src/__support/str_to_float.h b/libc/src/__support/str_to_float.h
index 8aeb3d2cea03..e8f0cb613b07 100644
--- a/libc/src/__support/str_to_float.h
+++ b/libc/src/__support/str_to_float.h
@@ -30,8 +30,8 @@ namespace LIBC_NAMESPACE {
 namespace internal {
 
 template <class T> struct ExpandedFloat {
-  typename fputil::FPBits<T>::StorageType mantissa;
-  int32_t exponent;
+  typename fputil::FPBits<T>::StorageType mantissa = {};
+  int32_t exponent = 0;
 };
 
 template <class T> struct FloatConvertReturn {
```
knocks out the first difference.

https://github.com/llvm/llvm-project/pull/78776


More information about the llvm-commits mailing list