Message ID | 831tndbgg8.fsf@gnu.org |
---|---|
State | New, archived |
Headers |
Received: (qmail 6079 invoked by alias); 2 Jan 2015 10:54:54 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 6062 invoked by uid 89); 2 Jan 2015 10:54:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, HDRS_LCASE, SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mtaout29.012.net.il Received: from mtaout29.012.net.il (HELO mtaout29.012.net.il) (80.179.55.185) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 02 Jan 2015 10:54:53 +0000 Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0NHJ00000PZHOQ00@mtaout29.012.net.il> for gdb-patches@sourceware.org; Fri, 02 Jan 2015 12:51:55 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NHJ0004HQ6JO910@mtaout29.012.net.il>; Fri, 02 Jan 2015 12:51:55 +0200 (IST) Date: Fri, 02 Jan 2015 12:54:47 +0200 From: Eli Zaretskii <eliz@gnu.org> Subject: Fix a MinGW warning in libiberty/strerror.c To: gdb-patches@sourceware.org, dj@redhat.com, gcc-patches@gcc.gnu.org Reply-to: Eli Zaretskii <eliz@gnu.org> Message-id: <831tndbgg8.fsf@gnu.org> X-IsSubscribed: yes |
Commit Message
Eli Zaretskii
Jan. 2, 2015, 10:54 a.m. UTC
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: OK to commit this (with a suitable ChangeLog entry)?
Comments
Ping! > Date: Fri, 02 Jan 2015 12:54:47 +0200 > From: Eli Zaretskii <eliz@gnu.org> > > 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)? >
Hi Eli, patch is reasonable and ok for me. Thanks Kai 2015-01-16 12:18 GMT+01:00 Eli Zaretskii <eliz@gnu.org>: > Ping! > >> Date: Fri, 02 Jan 2015 12:54:47 +0200 >> From: Eli Zaretskii <eliz@gnu.org> >> >> 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)? >>
> Date: Fri, 16 Jan 2015 12:34:25 +0100 > From: Kai Tietz <ktietz70@googlemail.com> > Cc: GCC Patches <gcc-patches@gcc.gnu.org>, > "gdb-patches@sourceware.org" <gdb-patches@sourceware.org> > > Hi Eli, > > patch is reasonable and ok for me. Thanks. Do I need to hear from someone else approving this, or can I go ahead and commit?
2015-01-16 12:50 GMT+01:00 Eli Zaretskii <eliz@gnu.org>: >> Date: Fri, 16 Jan 2015 12:34:25 +0100 >> From: Kai Tietz <ktietz70@googlemail.com> >> Cc: GCC Patches <gcc-patches@gcc.gnu.org>, >> "gdb-patches@sourceware.org" <gdb-patches@sourceware.org> >> >> Hi Eli, >> >> patch is reasonable and ok for me. > > Thanks. Do I need to hear from someone else approving this, or can I > go ahead and commit? Well, from POV of the Windows-maintainer in gcc, the patch is ok. As libiberty is shared with other ventures, you might want to get an ok by other ventures, too. I would say, as long as there are no objections - and there weren't any now for some time this patch waiting for comments - I would go ahead and say patch is ok. Regards, Kai
> Thanks. Do I need to hear from someone else approving this, or can I > go ahead and commit? Go ahead and commit.
> Date: Fri, 16 Jan 2015 16:39:20 -0500 > From: DJ Delorie <dj@redhat.com> > CC: ktietz70@googlemail.com, gcc-patches@gcc.gnu.org, > gdb-patches@sourceware.org > > > > Thanks. Do I need to hear from someone else approving this, or can I > > go ahead and commit? > > Go ahead and commit. Thanks. Last-minute thought, in case I'm confused: you mean commit to the sourceware Git repo, right? If not, where?
--- 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