[committed] libstdc++: Initialize local variable in __gnu_cxx::rope

Jonathan Wakely jwakely@redhat.com
Tue Oct 7 11:17:46 GMT 2025


This avoids -Wmaybe-uninitialized warnings.

libstdc++-v3/ChangeLog:

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

Tested powerpc64le-linux. Pushed to trunk.

 libstdc++-v3/include/ext/ropeimpl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libstdc++-v3/include/ext/ropeimpl.h b/libstdc++-v3/include/ext/ropeimpl.h
index 320192706ff9..00b334cb4f4e 100644
--- a/libstdc++-v3/include/ext/ropeimpl.h
+++ b/libstdc++-v3/include/ext/ropeimpl.h
@@ -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;
-- 
2.51.0



More information about the Libstdc++ mailing list