From patchwork Fri May 19 09:10:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Zaretskii X-Patchwork-Id: 20501 Received: (qmail 124939 invoked by alias); 19 May 2017 09:10:35 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 124565 invoked by uid 89); 19 May 2017 09:10:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=contrary X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 19 May 2017 09:10:31 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dBdvZ-0007eN-E9 for gdb-patches@sourceware.org; Fri, 19 May 2017 05:10:32 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41791) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dBdvZ-0007eI-AL; Fri, 19 May 2017 05:10:29 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3352 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dBdvY-0004M7-JM; Fri, 19 May 2017 05:10:28 -0400 Date: Fri, 19 May 2017 12:10:23 +0300 Message-Id: <83y3tt2ow0.fsf@gnu.org> From: Eli Zaretskii To: brobecker@adacore.com, simon.marchi@polymtl.ca CC: gdb-patches@sourceware.org In-reply-to: <83fug35v70.fsf@gnu.org> (message from Eli Zaretskii on Wed, 17 May 2017 19:01:23 +0300) Subject: Re: GDB 7.99.91 MinGW compilation error in cli-script.c Reply-to: Eli Zaretskii References: <20170504194442.63AAF60B72@joel.gnat.com> <83o9v3cs25.fsf@gnu.org> <91d9fc6cc7c07674a0b5cd02e7b1502b@polymtl.ca> <8360h38r1r.fsf@gnu.org> <20170517143136.mdnstf2u2jiydvnd@adacore.com> <83fug35v70.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-IsSubscribed: yes > Date: Wed, 17 May 2017 19:01:23 +0300 > From: Eli Zaretskii > CC: simon.marchi@polymtl.ca, gdb-patches@sourceware.org > > I will probably post later a workaround patch for older versions, > but that's for master. I see no reason to delay the release or to > have the fix on the branch. Is the below OK? It's a bit ugly, and a small fix is needed even for the latest MinGW runtime. Contrary to what I wrote, maybe it's also should be considered for the branch. Let me know what you think. diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c index e0e27ef..ec33a37 100644 --- a/gdb/cli/cli-script.c +++ b/gdb/cli/cli-script.c @@ -17,6 +17,23 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#if defined __MINGW32__ +# include <_mingw.h> +# ifndef __MINGW64_VERSION_MAJOR +// For versions of mingw.org's MinGW runtime before 5.0, make sure +// libstdc++ headers don't omit portions that require C99. +# if __MINGW32_MAJOR_VERSION < 5 +# ifndef _GLIBCXX_USE_C99 +# define _GLIBCXX_USE_C99 1 +# endif +# else +// This is required with mingwrt-5.0 to avoid linking errors due to +// multiple definitions of vsnprintf. +# undef __USE_MINGW_ANSI_STDIO +# endif +# endif +#endif + #include "defs.h" #include "value.h" #include "language.h" /* For value_true */