From f49667c7db2f322d1fd58b8964b523effa872a78 Mon Sep 17 00:00:00 2001 From: "Kirill A. Korinsky" Date: Tue, 14 Nov 2023 09:11:48 +0000 Subject: [PATCH] gcc: fix build by ISO C++98 compiler ISO C++98 forbids direct initialization of member, and requires to use member initializer lists at constructor. This fixes a regression introduced at f543f71c54be74256fb4ff7ab0142ffee55e999c Signed-off-by: Kirill A. Korinsky --- gcc/opts-common.c | 6 ++++++ gcc/opts-jobserver.h | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git gcc/opts-common.c gcc/opts-common.c index e5d08047b52..f8463cb595d 100644 --- gcc/opts-common.c +++ gcc/opts-common.c @@ -1809,6 +1809,12 @@ void prepend_xassembler_to_collect_as_options (const char *collect_as_options, } jobserver_info::jobserver_info () + : error_msg("") + , skipped_makeflags("") + , rfd(-1) + , wfd(-1) + , pipe_path("") + , is_active(false) { /* Traditionally, GNU make uses opened pipes for jobserver-auth, e.g. --jobserver-auth=3,4. diff --git gcc/opts-jobserver.h gcc/opts-jobserver.h index 98ea2579962..e04cba17dba 100644 --- gcc/opts-jobserver.h +++ gcc/opts-jobserver.h @@ -30,17 +30,17 @@ struct jobserver_info jobserver_info (); /* Error message if there is a problem. */ - string error_msg = ""; + string error_msg; /* Skipped MAKEFLAGS where --jobserver-auth is skipped. */ - string skipped_makeflags = ""; + string skipped_makeflags; /* File descriptor for reading used for jobserver communication. */ - int rfd = -1; + int rfd; /* File descriptor for writing used for jobserver communication. */ - int wfd = -1; + int wfd; /* Named pipe path. */ - string pipe_path = ""; + string pipe_path; /* Return true if jobserver is active. */ - bool is_active = false; + bool is_active; }; #endif /* GCC_JOBSERVER_H */ -- 2.42.1