]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Initialize local variable in __gnu_cxx::rope
authorJonathan Wakely <jwakely@redhat.com>
Wed, 1 Oct 2025 14:12:35 +0000 (15:12 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 7 Oct 2025 11:15:28 +0000 (12:15 +0100)
This avoids -Wmaybe-uninitialized warnings.

libstdc++-v3/ChangeLog:

* include/ext/ropeimpl.h (rope::_S_fetch): Initialize variable.

libstdc++-v3/include/ext/ropeimpl.h

index 320192706ff9876adba65dba7535d7afe51d1dd5..00b334cb4f4e9423b59af3dfb458405a76b52ae2 100644 (file)
@@ -1355,7 +1355,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
            case __detail::_S_substringfn:
              {
                _RopeFunction* __f = (_RopeFunction*)__r;
-               _CharT __result;
+               _CharT __result = _CharT();
 
                (*(__f->_M_fn))(__i, 1, &__result);
                return __result;