From: Eli Zaretskii <eliz@gnu.org>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PUSHED] Fix go32-nat.c build fallout from to_detach constification.
Date: Wed, 15 Jan 2014 17:13:00 -0000 [thread overview]
Message-ID: <83d2jt418x.fsf@gnu.org> (raw)
In-Reply-To: <52D6B91C.2030402@redhat.com>
> Date: Wed, 15 Jan 2014 16:36:44 +0000
> From: Pedro Alves <palves@redhat.com>
> CC: Eli Zaretskii <eliz@gnu.org>
>
> I pushed the patch below, approved by Eli offlist.
Thanks.
> FYI, djgpp still doesn't build OOTB:
>
> ../../src/binutils/readelf.c: In function 'print_symbol':
> ../../src/binutils/readelf.c:474:4: error: implicit declaration of function 'mbrtowc' [-Werror=implicit-function-declaration]
This is here:
#ifdef HAVE_MBSTATE_T
/* Try to find out how many bytes made up the character that was
just printed. Advance the symbol pointer past the bytes that
were displayed. */
n = mbrtowc (& w, symbol - 1, MB_CUR_MAX, & state); <<<<<<<<<
#else
n = 1;
#endif
The code (incorrectly) assumes that if the mbstate_t type is
supported, so is mbrtowc. DJGPP has the former, but not the latter.
I guess the solution is either to modify the HAVE_MBSTATE_T test or
add a HAVE_MBRTOWC test.
> cc1: all warnings being treated as errors
> ...
> ../../src/gdb/dwarf2read.c: In function 'open_and_init_dwp_file':
> ../../src/gdb/dwarf2read.c:10550:7: error: format '%d' expects argument of type 'int', but argument 2 has type 'uint32_t' [-Werror=format]
> ../../src/gdb/dwarf2read.c:10550:7: error: format '%d' expects argument of type 'int', but argument 3 has type 'uint32_t' [-Werror=format]
How does this compile on other platforms? I see this in dwarf2read.c:
struct dwp_hash_table
{
uint32_t version, nr_columns;
[...]
struct dwp_file
{
/* Name of the file. */
const char *name;
[...]
/* Table of CUs in the file. */
const struct dwp_hash_table *cus;
/* Table of TUs in the file. */
const struct dwp_hash_table *tus;
And the line which is flagged by the compiler is this:
/* The DWP file version is stored in the hash table. Oh well. */
if (dwp_file->cus->version != dwp_file->tus->version)
{
/* Technically speaking, we should try to limp along, but this is
pretty bizarre. */
error (_("Dwarf Error: DWP file CU version %d doesn't match" <<<<<<
" TU version %d [in DWP file %s]"), <<<<<<<<<<<<<<<<<<<<<<
dwp_file->cus->version, dwp_file->tus->version, dwp_name);
So it really tries to format uint32_t values with %d.
next prev parent reply other threads:[~2014-01-15 17:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-15 16:36 Pedro Alves
2014-01-15 17:13 ` Eli Zaretskii [this message]
2014-01-15 17:45 ` Pedro Alves
2014-01-15 21:25 ` Doug Evans
2014-01-16 2:52 ` Joel Brobecker
2014-01-16 17:35 ` Doug Evans
2014-01-16 12:56 ` Pedro Alves
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=83d2jt418x.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--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