https://gcc.gnu.org/g:40597e5d10c8828e49bd0576d3c96c007c1f3591
commit r17-5823-g40597e5d10c8828e49bd0576d3c96c007c1f3591 Author: David Malcolm <[email protected]> Date: Thu Oct 29 09:32:36 2026 -0400 Define INCLUDE_STRING in more places [PR128311] In r17-5669-g4a6c15e64ea599 I added a use of std::string to json.h Define INCLUDE_STRING before system.h in more places to ensure <string> is included. gcc/ChangeLog: PR diagnostics/128311 * custom-sarif-properties/cfg.cc: Define INCLUDE_STRING. * custom-sarif-properties/digraphs.cc: Likewise. * custom-sarif-properties/state-graphs.cc: Likewise. * gimple-pretty-print.cc: Likewise. * optinfo-emit-json.cc: Likewise. * optinfo.cc: Likewise. * print-rtl.cc: Likewise. * selftest-json.cc: Likewise. * timevar.cc: Likewise. Signed-off-by: David Malcolm <[email protected]> Diff: --- gcc/custom-sarif-properties/cfg.cc | 1 + gcc/custom-sarif-properties/digraphs.cc | 1 + gcc/custom-sarif-properties/state-graphs.cc | 1 + gcc/gimple-pretty-print.cc | 1 + gcc/optinfo-emit-json.cc | 1 + gcc/optinfo.cc | 1 + gcc/print-rtl.cc | 1 + gcc/selftest-json.cc | 1 + gcc/timevar.cc | 1 + 9 files changed, 9 insertions(+) diff --git a/gcc/custom-sarif-properties/cfg.cc b/gcc/custom-sarif-properties/cfg.cc index 4b0974870070..cc6fdf05e9d6 100644 --- a/gcc/custom-sarif-properties/cfg.cc +++ b/gcc/custom-sarif-properties/cfg.cc @@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ +#define INCLUDE_STRING #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/custom-sarif-properties/digraphs.cc b/gcc/custom-sarif-properties/digraphs.cc index 7920bfdd8391..84589d7332e4 100644 --- a/gcc/custom-sarif-properties/digraphs.cc +++ b/gcc/custom-sarif-properties/digraphs.cc @@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ +#define INCLUDE_STRING #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/custom-sarif-properties/state-graphs.cc b/gcc/custom-sarif-properties/state-graphs.cc index 6d44e9d098a1..acd8f7a05b3b 100644 --- a/gcc/custom-sarif-properties/state-graphs.cc +++ b/gcc/custom-sarif-properties/state-graphs.cc @@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ +#define INCLUDE_STRING #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/gimple-pretty-print.cc b/gcc/gimple-pretty-print.cc index 69148dd5cbd3..7adcc4bb075c 100644 --- a/gcc/gimple-pretty-print.cc +++ b/gcc/gimple-pretty-print.cc @@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ +#define INCLUDE_STRING #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/optinfo-emit-json.cc b/gcc/optinfo-emit-json.cc index 5baa26449df6..0d8df9866f5d 100644 --- a/gcc/optinfo-emit-json.cc +++ b/gcc/optinfo-emit-json.cc @@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ +#define INCLUDE_STRING #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/optinfo.cc b/gcc/optinfo.cc index 6e05c36a786b..3300a0afaaab 100644 --- a/gcc/optinfo.cc +++ b/gcc/optinfo.cc @@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ +#define INCLUDE_STRING #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/print-rtl.cc b/gcc/print-rtl.cc index e8d003173a64..d7fddf2f8ee0 100644 --- a/gcc/print-rtl.cc +++ b/gcc/print-rtl.cc @@ -25,6 +25,7 @@ along with GCC; see the file COPYING3. If not see #include "config.h" #endif +#define INCLUDE_STRING #include "system.h" #include "coretypes.h" #include "tm.h" diff --git a/gcc/selftest-json.cc b/gcc/selftest-json.cc index e9bfdb46cf34..bc51e78eff76 100644 --- a/gcc/selftest-json.cc +++ b/gcc/selftest-json.cc @@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ +#define INCLUDE_STRING #include "config.h" #include "system.h" #include "coretypes.h" diff --git a/gcc/timevar.cc b/gcc/timevar.cc index 2b2dd9386af2..192db583536b 100644 --- a/gcc/timevar.cc +++ b/gcc/timevar.cc @@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ +#define INCLUDE_STRING #include "config.h" #include "system.h" #include "coretypes.h"
