From: Chen Gang <gang.chen.5i5j@gmail.com>
To: jan.kratochvil@redhat.com, drow@false.org,
ezannoni@kwikemart.cygnus.com, brobecker@gnat.com,
muller@sourceware.org, palves@redhat.com, nickc@redhat.com,
macro@linux-mips.org, clm@redhat.com, amodra@gmail.com
Cc: binutils@sourceware.org
Subject: [PATCH] readline/util.c: use '%d' instead of 'ld' to avoid compiling warning
Date: Fri, 30 May 2014 00:11:00 -0000 [thread overview]
Message-ID: <5387CCBD.7070203@gmail.com> (raw)
getpid() will return 'pid_t' which is always 'int', so need use '%d'
instead of '%ld' in sprintf().
The related warning (cross-compile aarch64):
../../binutils-gdb/readline/util.c: In function ‘_rl_tropen’:
../../binutils-gdb/readline/util.c:510:3: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘__pid_t’ [-Wformat]
Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
readline/util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/readline/util.c b/readline/util.c
index 321dee2..05c8abc 100644
--- a/readline/util.c
+++ b/readline/util.c
@@ -507,7 +507,7 @@ _rl_tropen ()
if (_rl_tracefp)
fclose (_rl_tracefp);
- sprintf (fnbuf, "/var/tmp/rltrace.%ld", getpid());
+ sprintf (fnbuf, "/var/tmp/rltrace.%d", getpid());
unlink(fnbuf);
_rl_tracefp = fopen (fnbuf, "w+");
return _rl_tracefp != 0;
--
1.9.2.459.g68773ac
next reply other threads:[~2014-05-30 0:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-30 0:11 Chen Gang [this message]
2014-05-30 2:15 ` Alan Modra
2014-05-30 2:22 ` Alan Modra
2014-05-30 2:28 ` Chen Gang
2014-05-30 2:50 ` Chen Gang
2014-05-30 8:27 ` Pedro Alves
[not found] ` <87lhtj7han.fsf@igel.home>
2014-05-30 16:43 ` Chen Gang
2014-09-15 11:14 ` Chen Gang
2014-05-30 17:02 Chen Gang
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=5387CCBD.7070203@gmail.com \
--to=gang.chen.5i5j@gmail.com \
--cc=amodra@gmail.com \
--cc=binutils@sourceware.org \
--cc=brobecker@gnat.com \
--cc=clm@redhat.com \
--cc=drow@false.org \
--cc=ezannoni@kwikemart.cygnus.com \
--cc=jan.kratochvil@redhat.com \
--cc=macro@linux-mips.org \
--cc=muller@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).