From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 82766 invoked by alias); 14 Oct 2016 07:15:20 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 82614 invoked by uid 89); 14 Oct 2016 07:15:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2196 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, 14 Oct 2016 07:15:06 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1buwhn-0008Kp-UY for gdb-patches@sourceware.org; Fri, 14 Oct 2016 03:15:04 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35238) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buwhn-0008Ka-RP; Fri, 14 Oct 2016 03:14:59 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1721 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpa (Exim 4.82) (envelope-from ) id 1buwhm-0003Yx-Ps; Fri, 14 Oct 2016 03:14:59 -0400 Date: Fri, 14 Oct 2016 07:15:00 -0000 Message-Id: <834m4f8kr7.fsf@gnu.org> From: Eli Zaretskii To: Pedro Alves CC: gdb-patches@sourceware.org In-reply-to: <26338bf9-0343-c69a-348c-fc437afe0a88@redhat.com> (message from Pedro Alves on Wed, 12 Oct 2016 18:46:28 +0100) Subject: Re: MinGW compilation errors due to strcasecmp Reply-to: Eli Zaretskii References: <83oa2tg459.fsf@gnu.org> <26338bf9-0343-c69a-348c-fc437afe0a88@redhat.com> 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 X-SW-Source: 2016-10/txt/msg00429.txt.bz2 > From: Pedro Alves > Date: Wed, 12 Oct 2016 18:46:28 +0100 > > On 10/09/2016 12:20 PM, Eli Zaretskii wrote: > > I've upgraded to the latest mingw.org's MinGW runtime lately, and that > > triggers compilation errors building GDB 7.12: > > > > g++ -O2 -gdwarf-4 -g3 -I. -I. -I./common -I./config -DLOCALEDIR="\"d:/usr/share/locale\"" -DHAVE_CONFIG_H -I./../include/opcode -I./../opcodes/.. -I./../readline/.. -I../bfd -I./../bfd -I./../include -I../libdecnumber -I./../libdecnumber -I./gnulib/import -Ibuild-gnulib/import -DTUI=1 -Id:/usr/include -Id:/usr/include/guile/2.0 -Id:/usr/Python26/include -Id:/usr/Python26/include -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wunused-but-set-parameter -Wunused-but-set-variable -Wno-sign-compare -Wno-write-strings -Wno-narrowing -Wno-format -c -o windows-nat.o -MT windows-nat.o -MMD -MP -MF .deps/windows-nat.Tpo windows-nat.c > > windows-nat.c: In function 'so_list* windows_make_so(const char*, LPVOID)': > > windows-nat.c:608:35: error: 'strcasecmp' was not declared in this scope > > if (strcasecmp (buf, "ntdll.dll") == 0) > > ^ > > windows-nat.c: In function 'int envvar_cmp(const void*, const void*)': > > windows-nat.c:2031:28: error: 'strcasecmp' was not declared in this scope > > return strcasecmp (*p, *q); > > ^ > > Makefile:1134: recipe for target `windows-nat.o' failed > > make[2]: *** [windows-nat.o] Error 1 > > > > A similar error happens in stap-probe.c. > > > > The reason for this is that MinGW runtime changed the place where the > > prototypes of strcasecmp and strncasecmp are declared: they are now in > > strings.h (which AFAIU is more compatible to other systems). But we > > don't include strings.h anywhere, although the configure script probes > > for it. I guess other platforms include that header indirectly > > somehow. > > > > My suggestion is to include it in common-defs.h, as shown below. > > > > Is it okay to push such a change to the repository (with a suitable > > ChangeLog entry, of course)? > > Sure. Pushed to master and cherry-picked to the 7.12 branch. Thanks.