From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: [RFA] compilation error in remote.c on sparc-solaris
Date: Fri, 07 Mar 2008 18:28:00 -0000 [thread overview]
Message-ID: <20080307182744.GG3995@adacore.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 942 bytes --]
Hello,
I get the following warning when compiling remote.c on a sparc-solaris
machine:
remote.c: In function 'extended_remote_attach_1':
remote.c:2859: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'pid_t'
I think the problem is that, on sparc-solaris, type pid_t is defined
as a "long", whereas on other machines I've built GDB on, it's an int.
Variable pid is defined as follow:
pid_t pid;
I think it's good enough to change its type to "int". I've never seen
a PID that's larger than 7 digits, so an int should always be big enough.
In any case, that's what the pid_t structure uses for the pid.
2008-03-07 Joel Brobecker <brobecker@adacore.com>
* remote.c (extended_remote_attach_1): Make local variable pid an int
instead of a pid_t.
Tested on sparc-solaris by rebuilding remote.o (I tried with both
a 32bit compiler and a 64bit compiler).
OK to apply?
Thanks,
--
Joel
[-- Attachment #2: remote.c.diff --]
[-- Type: text/plain, Size: 369 bytes --]
Index: remote.c
===================================================================
--- remote.c (revision 34865)
+++ remote.c (revision 34866)
@@ -2841,7 +2841,7 @@ static void
extended_remote_attach_1 (struct target_ops *target, char *args, int from_tty)
{
struct remote_state *rs = get_remote_state ();
- pid_t pid;
+ int pid;
char *dummy;
if (!args)
next reply other threads:[~2008-03-07 18:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-07 18:28 Joel Brobecker [this message]
2008-03-07 18:55 ` Michael Snyder
2008-03-07 19:02 ` Daniel Jacobowitz
2008-03-07 19:15 ` Michael Snyder
2008-03-07 19:44 ` Joel Brobecker
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=20080307182744.GG3995@adacore.com \
--to=brobecker@adacore.com \
--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