From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
To: "'nick clifton'" <nickc@redhat.com>,
"'Pedro Alves'" <palves@redhat.com>,
"'asmwarrior'" <asmwarrior@gmail.com>
Cc: "'GDB Development'" <gdb@sourceware.org>,
"'Binutils Development'" <binutils@sourceware.org>
Subject: RE: [RFC-v2] BFD MinGW/Cygwin build error in bfd/peiXXgen.c
Date: Thu, 19 Dec 2013 13:18:00 -0000 [thread overview]
Message-ID: <007801cefcbc$d4d2d080$7e787180$@muller@ics-cnrs.unistra.fr> (raw)
In-Reply-To: <52B2E8C4.3080208@redhat.com>
> > 2013-12-19 Pierre Muller <muller@sourceware.org>
> >
> > peXXigen.c (u16_mbtouc): Avoid unused function warning by
> excluding if
> > __CYGWIN__ or __MINGW32__ macro is defined.
> > (rsrc_cmp): Fix Windows host version and version without wchar
> header.
> > [__CYGWIN__, __MINGW32__]: Introduce rsrccmp macro.
>
> Thanks - I have applied this patch.
Not yet completely OK:
peigen.c: In function ‘rsrc_cmp’:
peigen.c:2984:17: erreur: unused variable ‘i’ [-Werror=unused-variable]
ChangeLog entry:
2013-12-19 Pierre Muller <muller@sourceware.org>
Fix unused variable warning.
diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
index 843cae8..d50db73 100644
--- a/bfd/peXXigen.c
+++ b/bfd/peXXigen.c
@@ -2981,7 +2981,6 @@ static signed int
rsrc_cmp (bfd_boolean is_name, rsrc_entry * a, rsrc_entry * b)
{
signed int res;
- unsigned int i;
bfd_byte * astring;
unsigned int alen;
bfd_byte * bstring;
@@ -3013,24 +3012,26 @@ rsrc_cmp (bfd_boolean is_name, rsrc_entry * a, rsrc_entry * b)
min (alen, blen));
#elif defined HAVE_WCHAR_H
- res = 0;
- for (i = min (alen, blen); i--; astring += 2, bstring += 2)
- {
- wchar_t awc;
- wchar_t bwc;
-
- /* Convert UTF-16 unicode characters into wchar_t characters so
- that we can then perform a case insensitive comparison. */
- int Alen = u16_mbtouc (& awc, (const unsigned short *) astring, 2);
- int Blen = u16_mbtouc (& bwc, (const unsigned short *) bstring, 2);
-
- if (Alen != Blen)
- return Alen - Blen;
- res = wcsncasecmp (& awc, & bwc, 1);
- if (res)
- break;
- }
-
+ {
+ unsigned int i;
+ res = 0;
+ for (i = min (alen, blen); i--; astring += 2, bstring += 2)
+ {
+ wchar_t awc;
+ wchar_t bwc;
+
+ /* Convert UTF-16 unicode characters into wchar_t characters so
+ that we can then perform a case insensitive comparison. */
+ int Alen = u16_mbtouc (& awc, (const unsigned short *) astring, 2);
+ int Blen = u16_mbtouc (& bwc, (const unsigned short *) bstring, 2);
+
+ if (Alen != Blen)
+ return Alen - Blen;
+ res = wcsncasecmp (& awc, & bwc, 1);
+ if (res)
+ break;
+ }
+ }
#else
/* Do the best we can - a case sensitive, untranslated comparison. */
res = memcmp (astring, bstring, min (alen, blen) * 2);
next prev parent reply other threads:[~2013-12-19 13:18 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-18 9:54 GDB MinGW build error: implicit declaration of function 'wcsncasecmp' asmwarrior
2013-12-18 9:58 ` asmwarrior
2013-12-18 10:06 ` BFD " Pedro Alves
2013-12-18 12:50 ` asmwarrior
2013-12-18 15:47 ` Eli Zaretskii
2013-12-18 13:03 ` [RFC] BFD MinGW/Cygwin build error in bfd/peiXXgen.c Pierre Muller
2013-12-18 17:52 ` nick clifton
2013-12-19 11:45 ` [RFC-v2] " Pierre Muller
2013-12-19 12:41 ` nick clifton
2013-12-19 13:02 ` Mark Kettenis
2013-12-19 13:18 ` Pierre Muller [this message]
2013-12-19 15:13 ` nick clifton
[not found] ` <52b19d01.22cbc20a.69b0.ffffb29eSMTPIN_ADDED_BROKEN@mx.google.com>
2013-12-18 13:25 ` [RFC] " asmwarrior
[not found] ` <52b19d19.0850420a.7b6a.52dcSMTPIN_ADDED_BROKEN@mx.google.com>
2013-12-18 17:56 ` Pedro Alves
2013-12-19 11:15 ` nick clifton
2013-12-18 15:35 ` GDB MinGW build error: implicit declaration of function 'wcsncasecmp' 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='007801cefcbc$d4d2d080$7e787180$@muller@ics-cnrs.unistra.fr' \
--to=pierre.muller@ics-cnrs.unistra.fr \
--cc=asmwarrior@gmail.com \
--cc=binutils@sourceware.org \
--cc=gdb@sourceware.org \
--cc=nickc@redhat.com \
--cc=palves@redhat.com \
/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