From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5869 invoked by alias); 16 Jan 2015 11:34:32 -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 5836 invoked by uid 89); 16 Jan 2015 11:34:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_20,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wg0-f41.google.com Received: from mail-wg0-f41.google.com (HELO mail-wg0-f41.google.com) (74.125.82.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 16 Jan 2015 11:34:29 +0000 Received: by mail-wg0-f41.google.com with SMTP id l18so20069309wgh.0 for ; Fri, 16 Jan 2015 03:34:25 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.194.62.235 with SMTP id b11mr1445298wjs.73.1421408065705; Fri, 16 Jan 2015 03:34:25 -0800 (PST) Received: by 10.27.200.197 with HTTP; Fri, 16 Jan 2015 03:34:25 -0800 (PST) In-Reply-To: <8361c72cua.fsf@gnu.org> References: <831tndbgg8.fsf@gnu.org> <8361c72cua.fsf@gnu.org> Date: Fri, 16 Jan 2015 11:34:00 -0000 Message-ID: Subject: Re: Fix a MinGW warning in libiberty/strerror.c From: Kai Tietz To: Eli Zaretskii Cc: GCC Patches , "gdb-patches@sourceware.org" Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2015-01/txt/msg00454.txt.bz2 Hi Eli, patch is reasonable and ok for me. Thanks Kai 2015-01-16 12:18 GMT+01:00 Eli Zaretskii : > Ping! > >> Date: Fri, 02 Jan 2015 12:54:47 +0200 >> From: Eli Zaretskii >> >> When compiling GDB 7.8.1, I get this warning in libiberty: >> >> gcc -c -DHAVE_CONFIG_H -O0 -g3 -D__USE_MINGW_ACCESS -I. -I./../include -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic ./strerror.c -o strerror.o >> ./strerror.c:472:12: warning: '_sys_nerr' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes] >> ./strerror.c:473:14: warning: '_sys_errlist' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes] >> >> This happens because the MinGW system headers have some special magic >> for these variables, which are imported from a system shared library. >> >> The solution I propose is to refrain from declaring variables that are >> actually macros, because this should be a sign that something tricky >> is going on: >> >> --- libiberty/strerror.c~0 2014-06-11 18:34:41 +0300 >> +++ libiberty/strerror.c 2014-12-30 08:12:00 +0200 >> @@ -469,8 +469,13 @@ >> >> #else >> >> + >> +#ifndef sys_nerr >> extern int sys_nerr; >> +#endif >> +#ifndef sys_errlist >> extern char *sys_errlist[]; >> +#endif >> >> #endif >> >> >> OK to commit this (with a suitable ChangeLog entry)? >>