public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* Fix a MinGW warning in libiberty/strerror.c
@ 2015-01-02 10:54 Eli Zaretskii
  2015-01-16 11:18 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2015-01-02 10:54 UTC (permalink / raw)
  To: gdb-patches, dj, gcc-patches

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)?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Fix a MinGW warning in libiberty/strerror.c
  2015-01-02 10:54 Fix a MinGW warning in libiberty/strerror.c Eli Zaretskii
@ 2015-01-16 11:18 ` Eli Zaretskii
  2015-01-16 11:34   ` Kai Tietz
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2015-01-16 11:18 UTC (permalink / raw)
  To: gcc-patches; +Cc: gdb-patches

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)?
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Fix a MinGW warning in libiberty/strerror.c
  2015-01-16 11:18 ` Eli Zaretskii
@ 2015-01-16 11:34   ` Kai Tietz
  2015-01-16 11:49     ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Kai Tietz @ 2015-01-16 11:34 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: GCC Patches, gdb-patches

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)?
>>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Fix a MinGW warning in libiberty/strerror.c
  2015-01-16 11:34   ` Kai Tietz
@ 2015-01-16 11:49     ` Eli Zaretskii
  2015-01-16 11:56       ` Kai Tietz
  2015-01-16 21:39       ` DJ Delorie
  0 siblings, 2 replies; 7+ messages in thread
From: Eli Zaretskii @ 2015-01-16 11:49 UTC (permalink / raw)
  To: Kai Tietz; +Cc: gcc-patches, gdb-patches

> 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?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Fix a MinGW warning in libiberty/strerror.c
  2015-01-16 11:49     ` Eli Zaretskii
@ 2015-01-16 11:56       ` Kai Tietz
  2015-01-16 21:39       ` DJ Delorie
  1 sibling, 0 replies; 7+ messages in thread
From: Kai Tietz @ 2015-01-16 11:56 UTC (permalink / raw)
  To: Eli Zaretskii, Nick Clifton; +Cc: GCC Patches, gdb-patches

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Fix a MinGW warning in libiberty/strerror.c
  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
  1 sibling, 1 reply; 7+ messages in thread
From: DJ Delorie @ 2015-01-16 21:39 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: ktietz70, gcc-patches, gdb-patches


> Thanks.  Do I need to hear from someone else approving this, or can I
> go ahead and commit?

Go ahead and commit.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Fix a MinGW warning in libiberty/strerror.c
  2015-01-16 21:39       ` DJ Delorie
@ 2015-01-17  9:44         ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2015-01-17  9:44 UTC (permalink / raw)
  To: DJ Delorie; +Cc: ktietz70, gcc-patches, gdb-patches

> 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?

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-01-17  9:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-02 10:54 Fix a MinGW warning in libiberty/strerror.c Eli Zaretskii
2015-01-16 11:18 ` Eli Zaretskii
2015-01-16 11:34   ` Kai Tietz
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

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).