Use '::iterator' instead of '::const_iterator' on environ.c (and fix breakage on...
authorSergio Durigan Junior <sergiodj@redhat.com>
Tue, 20 Jun 2017 13:33:53 +0000 (09:33 -0400)
committerSergio Durigan Junior <sergiodj@redhat.com>
Tue, 20 Jun 2017 13:33:53 +0000 (09:33 -0400)
Even though C++11 supports modifying containers using a const_iterator
(e.g., calling the 'erase' method of a std::vector), early versions of
libstdc++ did not implement that.  Some of our buildslaves are using
these versions (e.g., the AArch64 buildslave uses gcc 4.8.8), and my
previous commit causes a breakage on them.  The solution is simple:
just use a normal iterator, without const.

gdb/ChangeLog:
2017-06-20  Sergio Durigan Junior  <sergiodj@redhat.com>

* common/environ.c (gdb_environ::unset): Use '::iterator' instead
of '::const_iterator'.

gdb/ChangeLog
gdb/common/environ.c

index 77001fadfb07c99e3650d47fa7858ec7ed56b296..f4e2b0823f85f566cbdd4f54eb99e660a0b12588 100644 (file)
@@ -1,3 +1,8 @@
+2017-06-20  Sergio Durigan Junior  <sergiodj@redhat.com>
+
+       * common/environ.c (gdb_environ::unset): Use '::iterator' instead
+       of '::const_iterator'.
+
 2017-06-20  Sergio Durigan Junior  <sergiodj@redhat.com>
 
        * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
index 20f8aba74b0cdaf75f98ae0abab905f55ddb0246..2d1395719b719bf408689ca20a4b9b74b7bda6cb 100644 (file)
@@ -116,8 +116,8 @@ gdb_environ::unset (const char *var)
 
   /* We iterate until '.cend () - 1' because the last element is
      always NULL.  */
-  for (std::vector<char *>::const_iterator el = m_environ_vector.cbegin ();
-       el != m_environ_vector.cend () - 1;
+  for (std::vector<char *>::iterator el = m_environ_vector.begin ();
+       el != m_environ_vector.end () - 1;
        ++el)
     if (match_var_in_string (*el, var, len))
       {
This page took 0.031244 seconds and 4 git commands to generate.