public inbox for gdb-cvs@sourceware.org help / color / mirror / Atom feed
From: Pedro Alves <palves@sourceware.org> To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Fix throw_winerror_with_name build error on x86-64 Cygwin Date: Fri, 23 Feb 2024 17:25:51 +0000 (GMT) [thread overview] Message-ID: <20240223172552.7C9503858CD1@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=593318f69b481f32f2a06093d2b9660b4fb77f24 commit 593318f69b481f32f2a06093d2b9660b4fb77f24 Author: Pedro Alves <pedro@palves.net> Date: Tue Feb 20 16:31:39 2024 +0000 Fix throw_winerror_with_name build error on x86-64 Cygwin The GDB build currently fails on x86-64 Cygwin, with: src/gdbsupport/errors.cc: In function ‘void throw_winerror_with_name(const char*, ULONGEST)’: src/gdbsupport/errors.cc:152:12: error: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘ULONGEST’ {aka ‘long unsigned int’} [-Werror=format=] 152 | error (_("%s (error %d): %s"), string, err, strwinerror (err)); | ^ Fix this by adding a cast. While at it, the error codes are really a DWORD that results from a GetLastError() call, so I think unsigned is more appropriate. That is also what strwinerror already does: sprintf (buf, "unknown win32 error (%u)", (unsigned) error); The cast is necessary on MinGW GDB as well, where ULONGEST is unsigned long long, but for some reason, I don't get a warning there. Approved-By: Tom Tromey <tom@tromey.com> Change-Id: I3f5faa779765fd8021abf58bb5f68d556b309d17 Diff: --- gdbsupport/errors.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdbsupport/errors.cc b/gdbsupport/errors.cc index 8ac3ed0da79..cccdc5cafb2 100644 --- a/gdbsupport/errors.cc +++ b/gdbsupport/errors.cc @@ -149,7 +149,7 @@ strwinerror (ULONGEST error) void throw_winerror_with_name (const char *string, ULONGEST err) { - error (_("%s (error %d): %s"), string, err, strwinerror (err)); + error (_("%s (error %u): %s"), string, (unsigned) err, strwinerror (err)); } #endif /* USE_WIN32API */
reply other threads:[~2024-02-23 17:25 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20240223172552.7C9503858CD1@sourceware.org \ --to=palves@sourceware.org \ --cc=gdb-cvs@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: linkBe 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).