From: Kai Tietz <ktietz70@googlemail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: Fix a MinGW warning in libiberty/strerror.c
Date: Fri, 16 Jan 2015 11:34:00 -0000 [thread overview]
Message-ID: <CAEwic4aHN1daqoP_prO4r2cRVx_L60FveKu_peDzEiVMaWZoyw@mail.gmail.com> (raw)
In-Reply-To: <8361c72cua.fsf@gnu.org>
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)?
>>
next prev parent reply other threads:[~2015-01-16 11:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-02 10:54 Eli Zaretskii
2015-01-16 11:18 ` Eli Zaretskii
2015-01-16 11:34 ` Kai Tietz [this message]
2015-01-16 11:49 ` Eli Zaretskii
2015-01-16 11:56 ` Kai Tietz
2015-01-16 21:39 ` DJ Delorie
2015-01-17 9:44 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAEwic4aHN1daqoP_prO4r2cRVx_L60FveKu_peDzEiVMaWZoyw@mail.gmail.com \
--to=ktietz70@googlemail.com \
--cc=eliz@gnu.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).